aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorIan2017-11-10 23:07:41 -0500
committerIan2017-11-11 14:46:59 -0500
commit94b3e786cd9d23ef972d366333abfbcfb1f7b989 (patch)
tree8a813a47b0d1853ba16695dbfa08a5202fae23f6 /editor/plugins/script_text_editor.cpp
parentfc299b4f370d586b75e1ae4f394cd3759ea4ae49 (diff)
downloadgodot-94b3e786cd9d23ef972d366333abfbcfb1f7b989.tar.gz
godot-94b3e786cd9d23ef972d366333abfbcfb1f7b989.tar.zst
godot-94b3e786cd9d23ef972d366333abfbcfb1f7b989.zip
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index adf65c11e..6b945157e 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -850,7 +850,8 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (line_id == 0 || next_id < 0)
return;
- swap_lines(tx, line_id, next_id);
+ tx->swap_lines(line_id, next_id);
+ tx->cursor_set_line(next_id);
}
int from_line_up = from_line > 0 ? from_line - 1 : from_line;
int to_line_up = to_line > 0 ? to_line - 1 : to_line;
@@ -862,7 +863,8 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (line_id == 0 || next_id < 0)
return;
- swap_lines(tx, line_id, next_id);
+ tx->swap_lines(line_id, next_id);
+ tx->cursor_set_line(next_id);
}
tx->end_complex_operation();
tx->update();
@@ -889,7 +891,8 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count())
return;
- swap_lines(tx, line_id, next_id);
+ tx->swap_lines(line_id, next_id);
+ tx->cursor_set_line(next_id);
}
int from_line_down = from_line < tx->get_line_count() ? from_line + 1 : from_line;
int to_line_down = to_line < tx->get_line_count() ? to_line + 1 : to_line;
@@ -901,7 +904,8 @@ void ScriptTextEditor::_edit_option(int p_op) {
if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count())
return;
- swap_lines(tx, line_id, next_id);
+ tx->swap_lines(line_id, next_id);
+ tx->cursor_set_line(next_id);
}
tx->end_complex_operation();
tx->update();