mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
GDScript: Allow mixed indentation on blank lines
This commit is contained in:
parent
16a93563bf
commit
00ad9e484e
4 changed files with 35 additions and 9 deletions
|
@ -1162,15 +1162,6 @@ void GDScriptTokenizer::check_indent() {
|
|||
_advance();
|
||||
}
|
||||
|
||||
if (mixed && !(line_continuation || multiline_mode)) {
|
||||
Token error = make_error("Mixed use of tabs and spaces for indentation.");
|
||||
error.start_line = line;
|
||||
error.start_column = 1;
|
||||
error.leftmost_column = 1;
|
||||
error.rightmost_column = column;
|
||||
push_error(error);
|
||||
}
|
||||
|
||||
if (_is_at_end()) {
|
||||
// Reached the end with an empty line, so just dedent as much as needed.
|
||||
pending_indents -= indent_level();
|
||||
|
@ -1214,6 +1205,15 @@ void GDScriptTokenizer::check_indent() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (mixed && !line_continuation && !multiline_mode) {
|
||||
Token error = make_error("Mixed use of tabs and spaces for indentation.");
|
||||
error.start_line = line;
|
||||
error.start_column = 1;
|
||||
error.leftmost_column = 1;
|
||||
error.rightmost_column = column;
|
||||
push_error(error);
|
||||
}
|
||||
|
||||
if (line_continuation || multiline_mode) {
|
||||
// We cleared up all the whitespace at the beginning of the line.
|
||||
// But if this is a continuation or multiline mode and we don't want any indentation change.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue