Fix deleting word from end of buffer (#4328)
commit1a772d1b67d4895d79273b027b1b1f86bd1616fe
authorJonathan LEI <me@xjonathan.dev>
dateWed 19 Oct 2022, 08:53 (4 years ago)
parent0c14d9f
helix-term/src/commands.rs+1−1
@@ -2885,7 +2885,7 @@ pub mod insert {
28852885
28862886 /// Exclude the cursor in range.
28872887 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() {
28892889 Range::new(
28902890 range.from(),
28912891 graphemes::prev_grapheme_boundary(text, cursor.to()),