diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-19 20:24:30 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:33 +0100 |
commit | 2869e942b4c30456826f0f61904d5b8e8f0b9abf (patch) | |
tree | 6a3e9e80be85a924697cd94341f58ebdaf1986de /qbuffers.cpp | |
parent | c2e9cdb33af9471c4d742c6a5f6fb25fd46d4fe7 (diff) | |
download | sciteco-2869e942b4c30456826f0f61904d5b8e8f0b9abf.tar.gz |
fixed EB rubout when there is an ADD hook: must not remove buffer before undoing hook
Diffstat (limited to 'qbuffers.cpp')
-rw-r--r-- | qbuffers.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/qbuffers.cpp b/qbuffers.cpp index 1ac06c7..77fefd5 100644 --- a/qbuffers.cpp +++ b/qbuffers.cpp @@ -422,10 +422,9 @@ Ring::is_any_dirty(void) return false; } -bool +void Ring::edit(const gchar *filename) { - bool new_in_ring = false; Buffer *buffer = find(filename); current_save_dot(); @@ -437,12 +436,11 @@ Ring::edit(const gchar *filename) execute_hook(HOOK_EDIT); } else { - new_in_ring = true; - buffer = new Buffer(); LIST_INSERT_HEAD(&head, buffer, buffers); current = buffer; + undo_close(); if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { buffer->load(filename); @@ -464,8 +462,6 @@ Ring::edit(const gchar *filename) execute_hook(HOOK_ADD); } - - return new_in_ring; } #if 0 @@ -679,8 +675,7 @@ StateEditFile::do_edit(const gchar *filename) ring.undo_edit(); else /* qregisters.current != NULL */ qregisters.undo_edit(); - if (ring.edit(filename)) - ring.undo_close(); + ring.edit(filename); } void |