aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan LEI2022-10-19 00:53:58 +0000
committerGitHub2022-10-19 00:53:58 +0000
commit1a772d1b67d4895d79273b027b1b1f86bd1616fe (patch)
treee8e6229f1b7ecf37a4b1cc73d260d707bdf52c69
parent0c14d9f869c503a873a420c4acab17bd922d1d3b (diff)
Fix deleting word from end of buffer (#4328)
-rw-r--r--helix-term/src/commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 318dd035..5073651b 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -2885,7 +2885,7 @@ pub mod insert {
/// Exclude the cursor in range.
fn exclude_cursor(text: RopeSlice, range: Range, cursor: Range) -> Range {
- if range.to() == cursor.to() {
+ if range.to() == cursor.to() && text.len_chars() != cursor.to() {
Range::new(
range.from(),
graphemes::prev_grapheme_boundary(text, cursor.to()),