summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-29 14:08:31 +0200
committerGitHub <noreply@github.com>2022-04-29 14:08:31 +0200
commit65aacd6b0af7d6fd7cc2f8b9d032bc130d0860fb (patch)
tree9e31bdc13ce54e170518225f3dd55e4e44efdfc5 /scene
parent700ca5bb3c934df6aeecc280ea2741cbabd51f7a (diff)
parent925e54ad65d30eb1eecdde31502dd554bf00bce7 (diff)
Merge pull request #60519 from nathanfranke/fix-newline-indent
fix lines with ':' that end in comments causing auto indent
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/code_edit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index d18a9a75de..fdcd7116f3 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -994,7 +994,8 @@ void CodeEdit::_new_line(bool p_split_current_line, bool p_above) {
}
/* Make sure this is the last char, trailing whitespace or comments are okay. */
- if (should_indent && (!is_whitespace(c) && is_in_comment(cl, cc) == -1)) {
+ /* Increment column for comments because the delimiter (#) should be ignored. */
+ if (should_indent && (!is_whitespace(c) && is_in_comment(cl, line_col + 1) == -1)) {
should_indent = false;
}
}