aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/textobject.rs
diff options
context:
space:
mode:
authorGokul Soumya2021-07-03 10:16:56 +0000
committerIvan Tham2021-07-03 12:20:24 +0000
commit351c1e7e5533a05a8e4da20d1e5227c356098b7b (patch)
tree8dab87275a81b42762942fb0c6d8a3daa9a49a63 /helix-core/src/textobject.rs
parent37f0b9ee159c13a8bc225b28219dfc485f4393a2 (diff)
Fix surround bug when cursor on same pair
For example when the cursor is _on_ the `'` in `'word'`, the cursor wouldn't move because the search for a matching pair started _from_ the position of the cursor and simply found itself.
Diffstat (limited to 'helix-core/src/textobject.rs')
-rw-r--r--helix-core/src/textobject.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/helix-core/src/textobject.rs b/helix-core/src/textobject.rs
index d29eb03c..fbf66256 100644
--- a/helix-core/src/textobject.rs
+++ b/helix-core/src/textobject.rs
@@ -247,14 +247,13 @@ mod test {
"samexx 'single' surround pairs",
vec![
(3, Inside, (3, 3), '\'', 1),
- // FIXME: surround doesn't work when *on* same chars pair
- // (7, Inner, (8, 13), '\'', 1),
+ (7, Inside, (8, 13), '\'', 1),
(10, Inside, (8, 13), '\'', 1),
- // (14, Inner, (8, 13), '\'', 1),
+ (14, Inside, (8, 13), '\'', 1),
(3, Around, (3, 3), '\'', 1),
- // (7, Around, (7, 14), '\'', 1),
+ (7, Around, (7, 14), '\'', 1),
(10, Around, (7, 14), '\'', 1),
- // (14, Around, (7, 14), '\'', 1),
+ (14, Around, (7, 14), '\'', 1),
],
),
(