diff options
Diffstat (limited to 'helix-core/src')
-rw-r--r-- | helix-core/src/textobject.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-core/src/textobject.rs b/helix-core/src/textobject.rs index e011c912..b06bca5d 100644 --- a/helix-core/src/textobject.rs +++ b/helix-core/src/textobject.rs @@ -32,10 +32,9 @@ fn find_word_boundary(slice: RopeSlice, mut pos: usize, direction: Direction) -> if category != prev_category && pos != 0 && pos != slice.len_chars() { return pos; } else { - if direction == Direction::Forward { - pos += 1; - } else { - pos = pos.saturating_sub(1); + match direction { + Direction::Forward => pos += 1, + Direction::Backward => pos = pos.saturating_sub(1), } prev_category = category; } |