Skip to content

Commit

Permalink
Fix deleting word from end of buffer (helix-editor#4328)
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI authored and pathwave committed Nov 4, 2022
1 parent bab557f commit 0c22861
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2892,7 +2892,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()),
Expand Down

0 comments on commit 0c22861

Please sign in to comment.