You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
fix: Editor, save script file: Triple quote string: spaces are converted into tabs
This commit is contained in:
@@ -1007,6 +1007,10 @@ void CodeEdit::convert_indent(int p_from_line, int p_to_line) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_in_string(i) != -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check chars in the line.
|
||||
int j = 0;
|
||||
int space_count = 0;
|
||||
|
||||
@@ -2831,6 +2831,16 @@ TEST_CASE("[SceneTree][CodeEdit] indent") {
|
||||
CHECK(code_edit->has_selection());
|
||||
CHECK(code_edit->get_selection_origin_column() == 2);
|
||||
CHECK(code_edit->get_caret_column() == 3);
|
||||
|
||||
// Multiline blocks.
|
||||
code_edit->set_text("'''\n test\n test\n'''");
|
||||
code_edit->select(1, 0, 1, 8);
|
||||
code_edit->convert_indent();
|
||||
CHECK(code_edit->get_line(1) == " test");
|
||||
CHECK(code_edit->get_line(2) == " test");
|
||||
CHECK(code_edit->has_selection());
|
||||
CHECK(code_edit->get_selection_origin_column() == 0);
|
||||
CHECK(code_edit->get_caret_column() == 8);
|
||||
}
|
||||
|
||||
SUBCASE("[CodeEdit] convert indent to spaces") {
|
||||
|
||||
Reference in New Issue
Block a user