diff --git a/edit/ChangeLog b/edit/ChangeLog index 6d604b22f..37e4f67ea 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,10 @@ 2003-07-08 Pavel Roskin + * edit-widget.h: Add new field loading_done. + * edit.c (edit_init): Set loading_done. + (edit_insert): Don't call edit_modification() before the file is + completely loaded. + * edit-widget.h: Eliminate unused explicit_syntax field. * edit-widget.h: Stop misusing "unsigned char" for boolean. diff --git a/edit/edit-widget.h b/edit/edit-widget.h index 5b4833f6f..4198abc89 100644 --- a/edit/edit-widget.h +++ b/edit/edit-widget.h @@ -53,6 +53,7 @@ struct WEdit { int force; /* how much of the screen do we redraw? */ int overwrite:1; /* Overwrite on type mode (as opposed to insert) */ int modified:1; /* File has been modified and needs saving */ + int loading_done:1; /* File has been loaded into the editor */ int locked:1; /* We hold lock on current file */ int screen_modified:1; /* File has been changed since the last screen draw */ int delete_file:1; /* New file, needs to be deleted unless modified */ diff --git a/edit/edit.c b/edit/edit.c index 19729a906..75420bb4a 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -553,6 +553,7 @@ edit_init (WEdit *edit, int lines, int columns, const char *filename, g_free (edit); return 0; } + edit->loading_done = 1; edit->modified = 0; edit->locked = 0; edit_load_syntax (edit, 0, 0); @@ -839,8 +840,10 @@ edit_insert (WEdit *edit, int c) edit->start_line++; } - /* tell that we've modified the file */ - edit_modification (edit); + /* Mark file as modified, unless the file hasn't been fully loaded */ + if (edit->loading_done) { + edit_modification (edit); + } /* now we must update some info on the file and check if a redraw is required */ if (c == '\n') {