1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Change behavior of String.right

This commit is contained in:
Tomasz Chabora
2020-02-13 16:42:49 +01:00
committed by kobewi
parent 78d85de13b
commit b1859510ab
16 changed files with 57 additions and 36 deletions

View File

@@ -1012,7 +1012,7 @@ void CodeTextEditor::convert_indent_to_spaces() {
if (cursor_line == i && cursor_column > j) {
cursor_column += indent_size - 1;
}
line = line.left(j) + indent + line.right(j + 1);
line = line.left(j) + indent + line.substr(j + 1);
}
j++;
}
@@ -1056,7 +1056,7 @@ void CodeTextEditor::convert_indent_to_tabs() {
if (cursor_line == i && cursor_column > j) {
cursor_column -= indent_size;
}
line = line.left(j - indent_size) + "\t" + line.right(j + 1);
line = line.left(j - indent_size) + "\t" + line.substr(j + 1);
j = 0;
space_count = -1;
}
@@ -1114,7 +1114,7 @@ void CodeTextEditor::convert_case(CaseStyle p_case) {
new_line = text_editor->get_line(i).left(begin_col) + new_line;
}
if (i == end) {
new_line = new_line + text_editor->get_line(i).right(end_col);
new_line = new_line + text_editor->get_line(i).substr(end_col);
}
text_editor->set_line(i, new_line);
}