diff --git a/edit/ChangeLog b/edit/ChangeLog index fe4240d2a..ff6056884 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,11 @@ 2003-07-20 Pavel Roskin + * editcmd.c (edit_quit_cmd): Don't save this command in the undo + stack. Don't force any refresh. Don't delete unsaved files, do + it ... + * edit.c (edit_clean): ... here. This ensures that unsaved + files from the mcedit command line are erased on Ctrl-n. + * editwidget.c (edit): Remove unused variable "framed". 2003-07-08 Adam Byrtek diff --git a/edit/edit.c b/edit/edit.c index 9916086b6..fd164f93b 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -592,6 +592,10 @@ edit_clean (WEdit *edit) if (option_save_position) edit_save_position (edit); + /* File specified on the mcedit command line and never saved */ + if (edit->delete_file) + unlink (edit->filename); + edit_free_syntax_rules (edit); book_mark_flush (edit, -1); for (; j <= MAXBUFF; j++) { diff --git a/edit/editcmd.c b/edit/editcmd.c index de9164c51..09c498764 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -2052,9 +2052,6 @@ void edit_search_cmd (WEdit * edit, int again) /* Real edit only */ void edit_quit_cmd (WEdit * edit) { - edit_push_action (edit, KEY_PRESS + edit->start_display); - - edit->force |= REDRAW_COMPLETELY; if (edit->modified) { switch (edit_query_dialog3 (_ ("Quit"), _ (" File was modified, Save with exit? "), _ ("Cancel quit"), _ ("&Yes"), _ ("&No"))) { case 1: @@ -2074,8 +2071,6 @@ void edit_quit_cmd (WEdit * edit) return; } } - else if (edit->delete_file) - unlink (edit->filename); dlg_stop (edit->widget.parent); }