1
0
Fork 0
This commit is contained in:
Kit Bishop 2025-02-28 01:36:16 +01:00 committed by GitHub
commit 66cdd2b084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1343,7 +1343,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));
}