From 646e0897829d7baf4b982c59d4bddade85199665 Mon Sep 17 00:00:00 2001 From: Paul Batty Date: Wed, 6 Apr 2016 07:36:29 +0100 Subject: Fixed text edit undo and redo operation interaction --- tools/editor/plugins/script_editor_plugin.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tools/editor') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index bef1a8e028..1b059f3d27 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(); -- cgit v1.2.3