+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>
* 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
char *ans = mallocstrcpy(NULL, "");
/* The last answer the user typed at the statusbar prompt. */
filestruct *edittop_save = openfile->edittop;
+ ssize_t was_current_lineno = openfile->current->lineno;
size_t current_x_save = openfile->current_x;
ssize_t current_y_save = openfile->current_y;
bool edittop_inside = FALSE;
/* Restore the old place we want. */
openfile->placewewant = pww_save;
- /* Mark the file as modified. */
- set_modified();
+ /* Mark the file as modified if it changed. */
+ if (openfile->current->lineno != was_current_lineno ||
+ openfile->current_x != current_x_save)
+ set_modified();
/* Update the screen. */
edit_refresh();