commit bd88b8b5a6206110856f0bcf0be3e9af4e8636ff
parent 0568f7a2b61807e8efeb7a2f6d94da7cd3cdc0be
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 28 Feb 2020 13:21:57 +0100
undo: do not mark the buffer as modified when pasting back nothing
This completes the fix for https://savannah.gnu.org/bugs/?57915.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/text.c b/src/text.c
@@ -669,6 +669,7 @@ void do_redo(void)
{
linestruct *line = NULL, *intruder;
char *data, *redidmsg = NULL;
+ bool suppress_modification = FALSE;
undostruct *u = openfile->undotop;
if (u == NULL || u == openfile->current_undo) {
@@ -764,6 +765,8 @@ void do_redo(void)
goto_line_posx(u->head_lineno, u->head_x);
if (u->cutbuffer)
copy_from_buffer(u->cutbuffer);
+ else
+ suppress_modification = TRUE;
free_lines(u->cutbuffer);
u->cutbuffer = NULL;
break;
@@ -814,7 +817,7 @@ void do_redo(void)
if (openfile->current_undo == openfile->last_saved) {
openfile->modified = FALSE;
titlebar(NULL);
- } else
+ } else if (!suppress_modification)
set_modified();
}
#endif /* !NANO_TINY */