aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPaulb232016-04-06 16:37:03 +0100
committerRémi Verschelde2016-04-06 19:39:30 +0200
commitb3891246e5349eae7700faa17348cfa3b9fd2c7f (patch)
tree95e37cfe330160fcd31e4d8833c3a3a571b12404 /tools
parent00566a859268f541d807e26c0d12fb9ced202af6 (diff)
downloadgodot-b3891246e5349eae7700faa17348cfa3b9fd2c7f.tar.gz
godot-b3891246e5349eae7700faa17348cfa3b9fd2c7f.tar.zst
godot-b3891246e5349eae7700faa17348cfa3b9fd2c7f.zip
Fixed block indent inconsistency, fixes issue 3803
(cherry picked from commit 93700676b5491ff41d0a14954e71327b99440f7e)
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index ece8df3fa..d74ce7ca3 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1160,24 +1160,7 @@ void ScriptEditor::_menu_option(int p_option) {
tx->begin_complex_operation();
if (tx->is_selection_active())
{
- int begin = tx->get_selection_from_line();
- int end = tx->get_selection_to_line();
- for (int i = begin; i <= end; i++)
- {
- String line_text = tx->get_line(i);
- // begins with tab
- if (line_text.begins_with("\t"))
- {
- line_text = line_text.substr(1, line_text.length());
- tx->set_line(i, line_text);
- }
- // begins with 4 spaces
- else if (line_text.begins_with(" "))
- {
- line_text = line_text.substr(4, line_text.length());
- tx->set_line(i, line_text);
- }
- }
+ tx->indent_selection_left();
}
else
{
@@ -1211,14 +1194,7 @@ void ScriptEditor::_menu_option(int p_option) {
tx->begin_complex_operation();
if (tx->is_selection_active())
{
- int begin = tx->get_selection_from_line();
- int end = tx->get_selection_to_line();
- for (int i = begin; i <= end; i++)
- {
- String line_text = tx->get_line(i);
- line_text = '\t' + line_text;
- tx->set_line(i, line_text);
- }
+ tx->indent_selection_right();
}
else
{