aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-26 17:51:00 +0000
committerNathan Vegdahl2021-07-26 17:51:00 +0000
commit5ee6ba5b38ebeb86006bb2e42734a2285eb354df (patch)
treec86575d25773c04cedecd023235aec5c00edee7c /helix-core
parent01247acf0cd06fcb3ba3b033e215b9b13b632816 (diff)
Address some PR comments.
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/textobject.rs7
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;
}