fix: crash when using block comment if no block comment but yes line comment

pull/12759/head
Nikita Revenco 2025-02-10 05:58:33 +00:00 committed by Nik Revenco
parent f18a2d7c5a
commit f8a38a1229
1 changed files with 5 additions and 1 deletions

View File

@ -5295,7 +5295,11 @@ fn toggle_block_comments(cx: &mut Context) {
}), }),
); );
transaction.with_selection(Selection::new(selections, selection.primary_index())) if selections.is_empty() {
transaction
} else {
transaction.with_selection(Selection::new(selections, selection.primary_index()))
}
}, },
); );
} }