on master help sign in
Fix deleting word from end of buffer (#4328)
1a772d1Jonathan LEI
helix-term/src/commands.rs+1−1
@@ -2885,7 +2885,7 @@ pub mod insert {
2885
2885
2886 /// Exclude the cursor in range.
2886 /// Exclude the cursor in range.
2887 fn exclude_cursor(text: RopeSlice, range: Range, cursor: Range) -> Range {
2887 fn exclude_cursor(text: RopeSlice, range: Range, cursor: Range) -> Range {
2888− if range.to() == cursor.to() {
2888+ if range.to() == cursor.to() && text.len_chars() != cursor.to() {
2889 Range::new(
2889 Range::new(
2890 range.from(),
2890 range.from(),
2891 graphemes::prev_grapheme_boundary(text, cursor.to()),
2891 graphemes::prev_grapheme_boundary(text, cursor.to()),