Fix panics when triggering w or e on the last char of the line
Closes #32
This commit is contained in:
parent
c0264b9f7f
commit
3ace581191
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ pub fn move_next_word_start(slice: RopeSlice, mut begin: usize, count: usize) ->
|
||||||
let mut end = begin;
|
let mut end = begin;
|
||||||
|
|
||||||
for _ in 0..count {
|
for _ in 0..count {
|
||||||
if begin + 1 == slice.len_chars() {
|
if begin + 2 > slice.len_chars() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ pub fn move_next_word_end(slice: RopeSlice, mut begin: usize, count: usize) -> O
|
||||||
let mut end = begin;
|
let mut end = begin;
|
||||||
|
|
||||||
for _ in 0..count {
|
for _ in 0..count {
|
||||||
if begin + 1 == slice.len_chars() {
|
if begin + 2 > slice.len_chars() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue