mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix error when toggling comment with empty lines
This commit is contained in:
parent
037956dbc9
commit
0d18575ad1
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
text_editor->remove_text(line, delimiter_column, line, delimiter_column + delimiter.length());
|
||||
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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue