summaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2017-04-17 14:24:30 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2017-04-18 12:30:46 +0100
commit84bca4e72f191450a794de795de7142da87495c6 (patch)
treeccc3682f85292cdeef8187bd2bb434acedfd1f90 /editor/plugins/script_text_editor.cpp
parent95a2a7e525a1a981b54292d64639545df61deebe (diff)
Added support for space indentation
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 65be93e771..0eb53d1a66 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -298,10 +298,10 @@ void ScriptTextEditor::convert_indent_to_spaces() {
return;
}
- int tab_size = EditorSettings::get_singleton()->get("text_editor/indent/tab_size");
+ int indent_size = EditorSettings::get_singleton()->get("text_editor/indent/size");
String indent = "";
- for (int i = 0; i < tab_size; i++) {
+ for (int i = 0; i < indent_size; i++) {
indent += " ";
}
@@ -340,8 +340,8 @@ void ScriptTextEditor::convert_indent_to_tabs() {
return;
}
- int tab_size = EditorSettings::get_singleton()->get("text_editor/indent/tab_size");
- tab_size -= 1;
+ int indent_size = EditorSettings::get_singleton()->get("text_editor/indent/size");
+ indent_size -= 1;
bool changed_indentation = false;
for (int i = 0; i < tx->get_line_count(); i++) {
@@ -357,13 +357,13 @@ void ScriptTextEditor::convert_indent_to_tabs() {
if (line[j] != '\t') {
space_count++;
- if (space_count == tab_size) {
+ if (space_count == indent_size) {
if (!changed_indentation) {
tx->begin_complex_operation();
changed_indentation = true;
}
- line = line.left(j - tab_size) + "\t" + line.right(j + 1);
+ line = line.left(j - indent_size) + "\t" + line.right(j + 1);
j = 0;
space_count = -1;
}