aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/textobject.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-08-03 14:22:27 +0000
committerIvan Tham2021-08-04 01:55:59 +0000
commitc9cbc344fc28dee5a0a5d3a7662c5c223067ab23 (patch)
tree0ca76300265237c9f5d244eaba8306fdd144aab6 /helix-core/src/textobject.rs
parent8c3a5b14de37aa3bd9c5c9a0aa2645245d03b161 (diff)
Fix buggy surround behavior from #376.
Fixes #543.
Diffstat (limited to 'helix-core/src/textobject.rs')
-rw-r--r--helix-core/src/textobject.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/helix-core/src/textobject.rs b/helix-core/src/textobject.rs
index b06bca5d..b59ff6fa 100644
--- a/helix-core/src/textobject.rs
+++ b/helix-core/src/textobject.rs
@@ -98,11 +98,8 @@ pub fn textobject_surround(
) -> Range {
surround::find_nth_pairs_pos(slice, ch, range.head, count)
.map(|(anchor, head)| match textobject {
- TextObject::Inside => Range::new(
- next_grapheme_boundary(slice, anchor),
- prev_grapheme_boundary(slice, head),
- ),
- TextObject::Around => Range::new(anchor, head),
+ TextObject::Inside => Range::new(next_grapheme_boundary(slice, anchor), head),
+ TextObject::Around => Range::new(anchor, next_grapheme_boundary(slice, head)),
})
.unwrap_or(range)
}