Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/comment.rs')
-rw-r--r--helix-core/src/comment.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs
index 5985cac7..d63d05fa 100644
--- a/helix-core/src/comment.rs
+++ b/helix-core/src/comment.rs
@@ -4,8 +4,7 @@
use smallvec::SmallVec;
use crate::{
- syntax::config::BlockCommentToken, Change, Range, Rope, RopeSlice, Selection, Tendril,
- Transaction,
+ syntax::BlockCommentToken, Change, Range, Rope, RopeSlice, Selection, Tendril, Transaction,
};
use helix_stdx::rope::RopeSliceExt;
use std::borrow::Cow;
@@ -205,9 +204,13 @@ pub fn find_block_comments(
range: *range,
start_pos,
end_pos,
- start_margin: selection_slice.get_char(after_start) == Some(' '),
+ start_margin: selection_slice
+ .get_char(after_start)
+ .map_or(false, |c| c == ' '),
end_margin: after_start != before_end
- && (selection_slice.get_char(before_end) == Some(' ')),
+ && selection_slice
+ .get_char(before_end)
+ .map_or(false, |c| c == ' '),
start_token: start_token.to_string(),
end_token: end_token.to_string(),
});