on master help sign in
Add `m` textobject for pair under cursor (#961)
commitebc14d9d206a0960a97fd706bd8fbfbedf2fb203 authorOmnikar <omnikar5@gmail.com> dateWed 10 Nov 2021, 21:33 (5 years ago) parent4d22454
1 file changed+8
helix-term/src/commands.rs+8
helix-term/src/commands.rs+8
@@ -4819,6 +4819,14 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
48194819 'c' => textobject_treesitter("class", range),
48204820 'f' => textobject_treesitter("function", range),
48214821 'p' => textobject_treesitter("parameter", range),
4822+ 'm' => {
4823+ let ch = text.char(range.cursor(text));
4824+ if !ch.is_ascii_alphanumeric() {
4825+ textobject::textobject_surround(text, range, objtype, ch, count)
4826+ } else {
4827+ range
4828+ }
4829+ }
48224830 // TODO: cancel new ranges if inconsistent surround matches across lines
48234831 ch if !ch.is_ascii_alphanumeric() => {
48244832 textobject::textobject_surround(text, range, objtype, ch, count)