(insert_spaces_tab): refactor loop.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-10-28 10:14:10 +03:00
parent d4e59aa022
commit 442af62c07

View File

@ -1447,14 +1447,8 @@ insert_spaces_tab (WEdit * edit, gboolean half)
if (half)
i /= 2;
if (i != 0)
{
i = ((edit->curs_col / i) + 1) * i - edit->curs_col;
while (i > 0)
{
for (i = ((edit->curs_col / i) + 1) * i - edit->curs_col; i > 0; i -= space_width)
edit_insert (edit, ' ');
i -= space_width;
}
}
}
/* --------------------------------------------------------------------------------------------- */