commit fa21986ecf5805685cfa5a871a566c4397e2d5e2
parent 772137cabeb5e577405d9e3839f76fb157622b3c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 30 Apr 2019 12:42:16 +0200
oops: apparently the line numbers in the cutbuffer do matter
The line numbers don't matter for the cutbuffer itself, but they matter
for the copy of the cutbuffer that is stored in an undo item.
This reverts commit 14140d52 from two hours ago.
This fixes https://savannah.gnu.org/bugs/?56245.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -318,7 +318,10 @@ void extract_buffer(linestruct **buffer_top, linestruct **buffer_bot,
if (*buffer_top == NULL) {
*buffer_top = openfile->filetop;
*buffer_bot = openfile->filebot;
+ renumber_from(*buffer_top);
} else {
+ linestruct *was_bottom = *buffer_bot;
+
/* Tack the data of the first line of the text onto the data of
* the last line in the given buffer. */
(*buffer_bot)->data = charealloc((*buffer_bot)->data,
@@ -337,6 +340,8 @@ void extract_buffer(linestruct **buffer_top, linestruct **buffer_bot,
(*buffer_bot)->next->prev = *buffer_bot;
*buffer_bot = openfile->filebot;
}
+
+ renumber_from(was_bottom);
}
/* Since the text has now been saved, remove it from the file buffer. */