From 5ee6ba5b38ebeb86006bb2e42734a2285eb354df Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Mon, 26 Jul 2021 10:51:00 -0700 Subject: Address some PR comments. --- helix-core/src/textobject.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'helix-core/src') 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; } -- cgit v1.2.3-70-g09d2