summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-04-06 19:39:07 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-04-06 19:39:07 +0200
commit3e3f16fefc4dc8b9ffa40d3357f0959ac17163e7 (patch)
tree0d7c1ddd538dae39ba75f37a538738205dd8af3e /tools/editor/plugins
parente26f3dc03a76d71e01c3a3ebaa6fb0caf0580578 (diff)
parent93700676b5491ff41d0a14954e71327b99440f7e (diff)
Merge pull request #4251 from Paulb23/block_indent_issue_3803
Fixed block indent inconsistency, issue #3803
Diffstat (limited to 'tools/editor/plugins')
-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 30b75e8dcb..5f2efc8f03 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1161,24 +1161,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
{
@@ -1212,14 +1195,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
{