From e95373535c2ba82d683460fc26e82d0ce8f9a153 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 5 Apr 2003 01:43:58 +0000 Subject: [PATCH] * edit.c: Move edit_modification() before actions to provide proper repainting if there are dialogs invoked by actions. --- edit/ChangeLog | 3 +++ edit/edit.c | 12 +++++++----- edit/editlock.c | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index e7f09256f..9f12ee604 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,8 @@ 2003-04-04 Adam Byrtek + * edit.c: Move edit_modification() before actions to provide + proper repainting if there are dialogs invoked by actions. + * editlock.c: Split lock into user@host and pid and report them separately. diff --git a/edit/edit.c b/edit/edit.c index 62a59c786..c0fb22a98 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -838,6 +838,10 @@ edit_insert (WEdit *edit, int c) if (c == '\n') edit->start_line++; } + + /* tell that we've modified the file */ + edit_modification (edit); + /* now we must update some info on the file and check if a redraw is required */ if (c == '\n') { if (edit->book_mark) @@ -846,8 +850,6 @@ edit_insert (WEdit *edit, int c) edit->total_lines++; edit->force |= REDRAW_LINE_ABOVE | REDRAW_AFTER_CURSOR; } - /* tell that we've modified the file */ - edit_modification (edit); /* save the reverse command onto the undo stack */ edit_push_action (edit, BACKSPACE); @@ -885,13 +887,13 @@ void edit_insert_ahead (WEdit * edit, int c) if (c == '\n') edit->start_line++; } + edit_modification (edit); if (c == '\n') { if (edit->book_mark) book_mark_inc (edit, edit->curs_line); edit->total_lines++; edit->force |= REDRAW_AFTER_CURSOR; } - edit_modification (edit); edit_push_action (edit, DELCHAR); edit->mark1 += (edit->mark1 >= edit->curs1); @@ -926,6 +928,7 @@ int edit_delete (WEdit * edit) edit->last_byte--; edit->curs2--; + edit_modification (edit); if (p == '\n') { if (edit->book_mark) book_mark_dec (edit, edit->curs_line); @@ -938,7 +941,6 @@ int edit_delete (WEdit * edit) if (p == '\n') edit->start_line--; } - edit_modification (edit); return p; } @@ -963,6 +965,7 @@ edit_backspace (WEdit * edit) edit->last_byte--; edit->curs1--; + edit_modification (edit); if (p == '\n') { if (edit->book_mark) book_mark_dec (edit, edit->curs_line); @@ -977,7 +980,6 @@ edit_backspace (WEdit * edit) if (p == '\n') edit->start_line--; } - edit_modification (edit); return p; } diff --git a/edit/editlock.c b/edit/editlock.c index 2c21f3f32..ff42092c9 100644 --- a/edit/editlock.c +++ b/edit/editlock.c @@ -112,7 +112,8 @@ lock_get_info (char *lockfname) /* Tries to raise file lock - Returns 1 on success, 0 on failure, -1 if abort */ + Returns 1 on success, 0 on failure, -1 if abort + Warning: Might do screen refresh and lose edit->force */ int edit_lock_file (char *fname) {