Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inability to uncomment code in text shader editor #83822

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading