mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
* 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.
This commit is contained in:
parent
59593d0e1b
commit
5ff5f8e9d1
@ -1,5 +1,10 @@
|
|||||||
2003-07-08 Pavel Roskin <proski@gnu.org>
|
2003-07-08 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* 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: Eliminate unused explicit_syntax field.
|
||||||
|
|
||||||
* edit-widget.h: Stop misusing "unsigned char" for boolean.
|
* edit-widget.h: Stop misusing "unsigned char" for boolean.
|
||||||
|
@ -53,6 +53,7 @@ struct WEdit {
|
|||||||
int force; /* how much of the screen do we redraw? */
|
int force; /* how much of the screen do we redraw? */
|
||||||
int overwrite:1; /* Overwrite on type mode (as opposed to insert) */
|
int overwrite:1; /* Overwrite on type mode (as opposed to insert) */
|
||||||
int modified:1; /* File has been modified and needs saving */
|
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 locked:1; /* We hold lock on current file */
|
||||||
int screen_modified:1; /* File has been changed since the last screen draw */
|
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 */
|
int delete_file:1; /* New file, needs to be deleted unless modified */
|
||||||
|
@ -553,6 +553,7 @@ edit_init (WEdit *edit, int lines, int columns, const char *filename,
|
|||||||
g_free (edit);
|
g_free (edit);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
edit->loading_done = 1;
|
||||||
edit->modified = 0;
|
edit->modified = 0;
|
||||||
edit->locked = 0;
|
edit->locked = 0;
|
||||||
edit_load_syntax (edit, 0, 0);
|
edit_load_syntax (edit, 0, 0);
|
||||||
@ -839,8 +840,10 @@ edit_insert (WEdit *edit, int c)
|
|||||||
edit->start_line++;
|
edit->start_line++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tell that we've modified the file */
|
/* Mark file as modified, unless the file hasn't been fully loaded */
|
||||||
|
if (edit->loading_done) {
|
||||||
edit_modification (edit);
|
edit_modification (edit);
|
||||||
|
}
|
||||||
|
|
||||||
/* now we must update some info on the file and check if a redraw is required */
|
/* now we must update some info on the file and check if a redraw is required */
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
|
Loading…
Reference in New Issue
Block a user