Fix deleting word from end of buffer (#4328)

pull/1/head
Jonathan LEI 2 years ago committed by GitHub
parent 0c14d9f869
commit 1a772d1b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2885,7 +2885,7 @@ pub mod insert {
/// Exclude the cursor in range. /// Exclude the cursor in range.
fn exclude_cursor(text: RopeSlice, range: Range, cursor: Range) -> 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::new(
range.from(), range.from(),
graphemes::prev_grapheme_boundary(text, cursor.to()), graphemes::prev_grapheme_boundary(text, cursor.to()),

Loading…
Cancel
Save