diff options
author | Gokul Soumya | 2022-04-03 16:01:43 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-04-29 06:51:14 +0000 |
commit | de15d7017186cb735cdd31d12510f61a1707d5fb (patch) | |
tree | bd48c177f1ed50fdcaaa2cd57c8b993bd71f7bd7 /helix-term/src | |
parent | c22873c33fa0163257b1421faa6f91268ad3a4d1 (diff) |
Add `m` textobject to select closest surround pair
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d1c1724a..75c84b74 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4040,14 +4040,7 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { 'a' => textobject_treesitter("parameter", range), 'o' => textobject_treesitter("comment", range), 'p' => textobject::textobject_paragraph(text, range, objtype, count), - 'm' => { - let ch = text.char(range.cursor(text)); - if !ch.is_ascii_alphanumeric() { - textobject::textobject_surround(text, range, objtype, ch, count) - } else { - range - } - } + 'm' => textobject::textobject_surround_closest(text, range, objtype, count), // TODO: cancel new ranges if inconsistent surround matches across lines ch if !ch.is_ascii_alphanumeric() => { textobject::textobject_surround(text, range, objtype, ch, count) |