diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-28 12:31:14 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-28 12:31:14 +0200 |
| commit | b6c941fe9cdee91e2cb6ba2d8ceb95b21436bba8 (patch) | |
| tree | 4861c138f7d0a20a01b687a82cdac08aff0337b5 | |
| parent | 51875ac998517134d7c091ef98262cb61189d4ef (diff) | |
| parent | 961381cad522d1e3215cae4a9e420bbc41dc5726 (diff) | |
| download | redot-engine-b6c941fe9cdee91e2cb6ba2d8ceb95b21436bba8.tar.gz | |
Merge pull request #83822 from jsjtxietian/fix-can-not-uncomment-in-text-shader-editor
Fix unable to uncomment code in text shader editor
| -rw-r--r-- | editor/code_editor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 7e6a49d6c0..1842e8c1c4 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1514,8 +1514,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; - // `.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)) { + // 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).begins_with(delimiter))) { is_commented = false; break; } |
