Fix deleting word from end of buffer (#4328)
This commit is contained in:
parent
0c14d9f869
commit
1a772d1b67
@ -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…
Reference in New Issue
Block a user