Commit 91073be4 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

wrapping: don't trim a blank character that the user just typed

Trimming trailing spaces is good, but we should not trim the space
(or tab or other blank) that the user just typed and that caused the
hard-wrapping to occur.

This fixes https://savannah.gnu.org/bugs/?52948

.
Reported-by: default avatarAndreas Schamanek <schamane@fam.tuwien.ac.at>
No related merge requests found
Showing with 2 additions and 1 deletion
+2 -1
......@@ -1619,8 +1619,9 @@ bool do_wrap(filestruct *line)
/* When requested, snip trailing blanks off the wrapped line. */
if (ISSET(TRIM_BLANKS)) {
size_t cur_x = move_mbleft(line->data, wrap_loc);
size_t typed_x = move_mbleft(line->data, old_x);
while (is_blank_mbchar(line->data + cur_x)) {
while (is_blank_mbchar(line->data + cur_x) && cur_x != typed_x) {
openfile->current_x = cur_x;
do_delete();
cur_x = move_mbleft(line->data, cur_x);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment