You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix error when toggling comment with empty lines
This commit is contained in:
@@ -1356,7 +1356,9 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) {
|
||||
|
||||
if (is_commented) {
|
||||
int delimiter_column = text_editor->get_line(line).find(delimiter);
|
||||
if (delimiter_column != -1) {
|
||||
text_editor->remove_text(line, delimiter_column, line, delimiter_column + delimiter.length());
|
||||
}
|
||||
} else {
|
||||
text_editor->insert_text(delimiter, line, text_editor->get_first_non_whitespace_column(line));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user