mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix multiple comment delimiter break toggle comment shortcut
This commit is contained in:
parent
a574c0296b
commit
85d592dbf0
1 changed files with 2 additions and 1 deletions
|
@ -1505,7 +1505,8 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) {
|
|||
// Empty lines should not be counted.
|
||||
bool is_empty = text_editor->get_line(line).strip_edges().is_empty();
|
||||
is_all_empty = is_all_empty && is_empty;
|
||||
if (!is_empty && (delimiter_idx == -1 || text_editor->get_delimiter_start_key(delimiter_idx) != delimiter)) {
|
||||
// `.left(1)` here because get_delimiter_start_key will return `##` instead of `#` when there is multiple comment delimiter in a line.
|
||||
if (!is_empty && (delimiter_idx == -1 || text_editor->get_delimiter_start_key(delimiter_idx).left(1) != delimiter)) {
|
||||
is_commented = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue