Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with motion commands defined using match-word-by-style used with vi-delete



On Apr 22,  1:10am, Nikolai Weibull wrote:
}
} [...] $curcontext is set to zle:vi-delete, not, for example,
} zle:forward-word-match.
}
} It seems that this issue can be quite hard to fix, considering how
} vi-delete is currently implemented.  But perhaps there's an easy
} solution that I was unable to spot.

Try applying this same small change to each of the *-match functions:

--- 8< ---
@@ -3,7 +3,7 @@
 
 autoload match-words-by-style
 
-local curcontext=":zle:$WIDGET" word
+local curcontext=":zle:$WIDGETFUNC" word
 local -a matched_words
 integer count=${NUMERIC:-1}
 
--- 8< ---

I didn't actually try that because I'm not a vi mode user and I'm in
a hurry :-/ but it seems like it should do the trick.  If it doesn't,
try ${WIDGETFUNC%-match} instead.

} Until then I'm going to use my own vi-delete

Creating a vi-delete-match function seems like the next best thing.



Messages sorted by: Reverse Date, Date, Thread, Author