aboutsummaryrefslogtreecommitdiff
path: root/editor/plugins/shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorMattUV2017-12-14 10:10:53 +0100
committerMattUV2017-12-15 10:04:56 +0100
commitdb020f3cead0c9632fc80290298cee8a9eab3182 (patch)
treeebd4cc29197199aa36eedc82d49a6185ed2eae99 /editor/plugins/shader_editor_plugin.cpp
parentaa6772d7abb3ff1ff77b1b658617904bb0af1fbb (diff)
downloadgodot-db020f3cead0c9632fc80290298cee8a9eab3182.tar.gz
godot-db020f3cead0c9632fc80290298cee8a9eab3182.tar.zst
godot-db020f3cead0c9632fc80290298cee8a9eab3182.zip
Diffstat (limited to 'editor/plugins/shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/shader_editor_plugin.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index b390070b4..1d8afe7b9 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -379,26 +379,7 @@ void ShaderEditor::_menu_option(int p_option) {
if (shader.is_null())
return;
- tx->begin_complex_operation();
- if (tx->is_selection_active()) {
- tx->indent_selection_left();
- } else {
- int begin = tx->cursor_get_line();
- String line_text = tx->get_line(begin);
- // begins with tab
- if (line_text.begins_with("\t")) {
- line_text = line_text.substr(1, line_text.length());
- tx->set_line(begin, line_text);
- }
- // begins with 4 spaces
- else if (line_text.begins_with(" ")) {
- line_text = line_text.substr(4, line_text.length());
- tx->set_line(begin, line_text);
- }
- }
- tx->end_complex_operation();
- tx->update();
- //tx->deselect();
+ tx->indent_left();
} break;
case EDIT_INDENT_RIGHT: {
@@ -407,18 +388,7 @@ void ShaderEditor::_menu_option(int p_option) {
if (shader.is_null())
return;
- tx->begin_complex_operation();
- if (tx->is_selection_active()) {
- tx->indent_selection_right();
- } else {
- int begin = tx->cursor_get_line();
- String line_text = tx->get_line(begin);
- line_text = '\t' + line_text;
- tx->set_line(begin, line_text);
- }
- tx->end_complex_operation();
- tx->update();
- //tx->deselect();
+ tx->indent_right();
} break;
case EDIT_DELETE_LINE: {