You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Merge pull request #22894 from OsamaElHariri/prevent-comment-indent
A colon ending a comment line no longer indents the next line
This commit is contained in:
@@ -2331,9 +2331,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
|
||||
// no need to indent if we are going upwards.
|
||||
if (auto_indent && !(k->get_command() && k->get_shift())) {
|
||||
// indent once again if previous line will end with ':' or '{'
|
||||
// indent once again if previous line will end with ':' or '{' and the line is not a comment
|
||||
// (i.e. colon/brace precedes current cursor position)
|
||||
if (cursor.column > 0 && (text[cursor.line][cursor.column - 1] == ':' || text[cursor.line][cursor.column - 1] == '{')) {
|
||||
if (cursor.column > 0 && (text[cursor.line][cursor.column - 1] == ':' || text[cursor.line][cursor.column - 1] == '{') && !is_line_comment(cursor.line)) {
|
||||
if (indent_using_spaces) {
|
||||
ins += space_indent;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user