Skip to content

Commit b6c941f

Browse files
committed
Merge pull request #83822 from jsjtxietian/fix-can-not-uncomment-in-text-shader-editor
Fix unable to uncomment code in text shader editor
2 parents 51875ac + 961381c commit b6c941f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

editor/code_editor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,8 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) {
15141514
// Empty lines should not be counted.
15151515
bool is_empty = text_editor->get_line(line).strip_edges().is_empty();
15161516
is_all_empty = is_all_empty && is_empty;
1517-
// `.left(1)` here because get_delimiter_start_key will return `##` instead of `#` when there is multiple comment delimiter in a line.
1518-
if (!is_empty && (delimiter_idx == -1 || text_editor->get_delimiter_start_key(delimiter_idx).left(1) != delimiter)) {
1517+
// get_delimiter_start_key will return `##` instead of `#` when there is multiple comment delimiter in a line.
1518+
if (!is_empty && (delimiter_idx == -1 || !text_editor->get_delimiter_start_key(delimiter_idx).begins_with(delimiter))) {
15191519
is_commented = false;
15201520
break;
15211521
}

0 commit comments

Comments
 (0)