From 925e54ad65d30eb1eecdde31502dd554bf00bce7 Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Mon, 25 Apr 2022 14:56:47 -0500 Subject: fix lines ending in comments causing auto indent --- scene/gui/code_edit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene/gui/code_edit.cpp') 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; } } -- cgit v1.2.3