cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.13k stars 79 forks source link

Support wrapping a target with knausj common functions #1240

Open pkozlows opened 1 year ago

pkozlows commented 1 year ago

Some helpful links:

Can basically add an extra disjunct to the rule for cursorless_wrapper

auscompgeek commented 1 year ago

Workaround: take bat funk wrap <function> should work, but will change your cursor selection

pokey commented 1 year ago

Actually, now that I think about it, we used to support this, but got rid of it for some reason. See the first command of https://youtu.be/Py9xjeIhxOg @AndreasArvidsson any idea why we dropped that action?

AndreasArvidsson commented 1 year ago

I guess we were trying to limit Cursorless dependency on user/knausj implementations and we tried to avoid code insertion in Cursorless in favor of the change command.

pokey commented 1 year ago

Ok I did some git history sleuthing, and looks like this one hit the chopping block during DFA optimisation. I don't think that's a big concern anymore, so probably fine?

pkozlows commented 1 year ago

Take 'target' funk 'function' wrap. Is simply selecting the target and replacing it with the, for example, print function for me. Rap is getting recognized as tab, which doesn't usually happen, and i take as a sign that I'm doing the wrong command. If this type of workaround worked, I would actually have no problem. atm, doing "carve 'target'" "funk 'function'" "paste that" which works, but is more cumbersome.

pokey commented 1 year ago

Whoops; got the command wrong. I just edited the comment