Avoid creation of unwanted undo action when opening a saved-as file in a new tab.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1617 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
363690e9d4
commit
eedb6a42a1
@ -1,3 +1,9 @@
|
||||
2007-06-14 Enrico Tröger <enrico.troeger@uvena.de>
|
||||
|
||||
* src/callbacks.c: Avoid creation of unwanted undo action when opening
|
||||
a saved-as file in a new tab.
|
||||
|
||||
|
||||
2007-06-14 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/templates.c, src/interface.c, src/templates.h, src/tools.c,
|
||||
|
||||
@ -878,6 +878,9 @@ on_file_save_dialog_response (GtkDialog *dialog,
|
||||
// use old file type (or maybe NULL for auto detect would be better?)
|
||||
idx = document_new_file(utf8_filename, doc_list[idx].file_type);
|
||||
|
||||
sci_set_undo_collection(doc_list[idx].sci, FALSE); // avoid creation of an undo action
|
||||
sci_empty_undo_buffer(doc_list[idx].sci);
|
||||
|
||||
len = sci_get_length(doc_list[old_idx].sci) + 1;
|
||||
data = (gchar*) g_malloc(len);
|
||||
sci_get_text(doc_list[old_idx].sci, len, data);
|
||||
@ -891,6 +894,7 @@ on_file_save_dialog_response (GtkDialog *dialog,
|
||||
document_set_encoding(idx, doc_list[old_idx].encoding);
|
||||
sci_set_lines_wrapped(doc_list[idx].sci, doc_list[idx].line_breaking);
|
||||
sci_set_readonly(doc_list[idx].sci, doc_list[idx].readonly);
|
||||
sci_set_undo_collection(doc_list[idx].sci, TRUE);
|
||||
|
||||
ui_document_show_hide(idx);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user