wrapping: when copying the quoting part, adjust the file size accordingly

Simply adding the number of bytes in the quoting part is not entirely
correct, but... currently the indenting and commenting routines also
assume that the whitespace and commenting characters that are added or
removed are single-byte characters...  It will require another patch
to make this all fully correct, but for the default configuration
(and probably most other cases) the current fix will work fine.

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

Bug existed since version 4.4, commit 8fce33af from two years ago,
since this automatic copying of the quoting part was introduced.
master
Benno Schulenberg 2021-05-14 10:12:06 +02:00
parent f23e98dd3a
commit 51adf02d34
1 changed files with 1 additions and 0 deletions

View File

@ -1332,6 +1332,7 @@ bool do_wrap(void)
strncpy(line->data, line->prev->data, lead_len);
openfile->current_x += lead_len;
openfile->totsize += lead_len;
#ifndef NANO_TINY
free(openfile->undotop->strdata);
update_undo(ENTER);