diff options
| author | Paul Batty | 2016-04-06 07:36:29 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2016-04-06 18:48:31 +0200 |
| commit | 7c6d2e7062e72ac9d187ace77f95e250091418af (patch) | |
| tree | b56f8a44846e8f3b6b2966bbcfd07f8dbffd4bc6 /tools/editor/plugins/script_editor_plugin.cpp | |
| parent | eb927383f2ba6ced34343ee9fcd6173bba8a8147 (diff) | |
| download | godot-7c6d2e7062e72ac9d187ace77f95e250091418af.tar.gz godot-7c6d2e7062e72ac9d187ace77f95e250091418af.tar.zst godot-7c6d2e7062e72ac9d187ace77f95e250091418af.zip | |
Fixed text edit undo and redo operation interaction
(cherry picked from commit 646e0897829d7baf4b982c59d4bddade85199665)
Diffstat (limited to 'tools/editor/plugins/script_editor_plugin.cpp')
| -rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 328169265..ece8df3fa 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1071,6 +1071,7 @@ void ScriptEditor::_menu_option(int p_option) { if (scr.is_null()) return; + tx->begin_complex_operation(); if (tx->is_selection_active()) { int from_line = tx->get_selection_from_line(); @@ -1102,6 +1103,7 @@ void ScriptEditor::_menu_option(int p_option) { swap_lines(tx, line_id, next_id); } + tx->end_complex_operation(); tx->update(); } break; @@ -1112,6 +1114,7 @@ void ScriptEditor::_menu_option(int p_option) { if (scr.is_null()) return; + tx->begin_complex_operation(); if (tx->is_selection_active()) { int from_line = tx->get_selection_from_line(); @@ -1143,6 +1146,7 @@ void ScriptEditor::_menu_option(int p_option) { swap_lines(tx, line_id, next_id); } + tx->end_complex_operation(); tx->update(); } break; @@ -1153,7 +1157,7 @@ void ScriptEditor::_menu_option(int p_option) { if (scr.is_null()) return; - + tx->begin_complex_operation(); if (tx->is_selection_active()) { int begin = tx->get_selection_from_line(); @@ -1192,6 +1196,7 @@ void ScriptEditor::_menu_option(int p_option) { tx->set_line(begin, line_text); } } + tx->end_complex_operation(); tx->update(); //tx->deselect(); @@ -1203,6 +1208,7 @@ void ScriptEditor::_menu_option(int p_option) { if (scr.is_null()) return; + tx->begin_complex_operation(); if (tx->is_selection_active()) { int begin = tx->get_selection_from_line(); @@ -1221,6 +1227,7 @@ void ScriptEditor::_menu_option(int p_option) { line_text = '\t' + line_text; tx->set_line(begin, line_text); } + tx->end_complex_operation(); tx->update(); //tx->deselect(); @@ -1252,7 +1259,7 @@ void ScriptEditor::_menu_option(int p_option) { return; - + tx->begin_complex_operation(); if (tx->is_selection_active()) { int begin = tx->get_selection_from_line(); @@ -1284,6 +1291,7 @@ void ScriptEditor::_menu_option(int p_option) { line_text = "#" + line_text; tx->set_line(begin, line_text); } + tx->end_complex_operation(); tx->update(); //tx->deselect(); |
