1
1

text: upon Enter, eat only lefthand blanks, not any other characters

Make sure that there is only whitespace to the left of the cursor
before setting 'allblanks' to TRUE, because this latter value will
cause these characters to be eaten (as a special case, to avoid
creating lines that contain only blanks when both --autoindent
and --breaklonglines are on).

This fixes https://savannah.gnu.org/bugs/?63407.
Reported-by: Tasos Papastylianou <tpapastylianou@hotmail.com>

Bug existed since version 2.9.8, commit d00ab406.
Этот коммит содержится в:
Benno Schulenberg 2022-11-24 15:51:43 +01:00
родитель 4b4b20f8a9
Коммит 4f92b12a6a

Просмотреть файл

@ -877,7 +877,7 @@ void do_enter(void)
if (extra > openfile->current_x) if (extra > openfile->current_x)
extra = openfile->current_x; extra = openfile->current_x;
else if (extra == openfile->current_x) else if (extra == openfile->current_x)
allblanks = TRUE; allblanks = (indent_length(openfile->current->data) == extra);
} }
#endif /* NANO_TINY */ #endif /* NANO_TINY */
newnode->data = nmalloc(strlen(openfile->current->data + newnode->data = nmalloc(strlen(openfile->current->data +