Commit 6a88d8a7 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Marking the current buffer as mofified only when actually something

was inserted.  This fixes Savannah bug #45409.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5458 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 2 deletions
+9 -2
2015-12-01 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (do_insertfile): Mark the buffer as mofified only when
actually something was inserted. This fixes Savannah bug #45409.
2015-11-30 Benno Schulenberg <bensberg@justemail.net> 2015-11-30 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (redo_cut, update_undo): When cutting reaches the EOF, * src/text.c (redo_cut, update_undo): When cutting reaches the EOF,
and NONEWLINES is set, there is no next line at which to put the and NONEWLINES is set, there is no next line at which to put the
......
...@@ -1041,6 +1041,7 @@ void do_insertfile( ...@@ -1041,6 +1041,7 @@ void do_insertfile(
char *ans = mallocstrcpy(NULL, ""); char *ans = mallocstrcpy(NULL, "");
/* The last answer the user typed at the statusbar prompt. */ /* The last answer the user typed at the statusbar prompt. */
filestruct *edittop_save = openfile->edittop; filestruct *edittop_save = openfile->edittop;
ssize_t was_current_lineno = openfile->current->lineno;
size_t current_x_save = openfile->current_x; size_t current_x_save = openfile->current_x;
ssize_t current_y_save = openfile->current_y; ssize_t current_y_save = openfile->current_y;
bool edittop_inside = FALSE; bool edittop_inside = FALSE;
...@@ -1280,7 +1281,9 @@ void do_insertfile( ...@@ -1280,7 +1281,9 @@ void do_insertfile(
/* Restore the old place we want. */ /* Restore the old place we want. */
openfile->placewewant = pww_save; openfile->placewewant = pww_save;
/* Mark the file as modified. */ /* Mark the file as modified if it changed. */
if (openfile->current->lineno != was_current_lineno ||
openfile->current_x != current_x_save)
set_modified(); set_modified();
/* Update the screen. */ /* Update the screen. */
......
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