on master help sign in
Fix panics when triggering w or e on the last char of the line

Closes #32

commit3ace581191e9c23aae23d7aabacd29c6b8ed7f65 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 2 Jun 2021, 13:12 (5 years ago) parentc0264b9
1 file changed+2−2
helix-core/src/movement.rs+2−2
helix-core/src/movement.rs+2−2
@@ -64,7 +64,7 @@ pub fn move_next_word_start(slice: RopeSlice, mut begin: usize, count: usize) ->
6464 let mut end = begin;
6565
6666 for _ in 0..count {
67− if begin + 1 == slice.len_chars() {
67+ if begin + 2 > slice.len_chars() {
6868 return None;
6969 }
7070
@@ -134,7 +134,7 @@ pub fn move_next_word_end(slice: RopeSlice, mut begin: usize, count: usize) -> O
134134 let mut end = begin;
135135
136136 for _ in 0..count {
137− if begin + 1 == slice.len_chars() {
137+ if begin + 2 > slice.len_chars() {
138138 return None;
139139 }
140140