paradigm / TextObjectify

TextObjectify is a Vim plugin which improves text-objects
100 stars 6 forks source link

vi( and di( behave inconsistently #6

Open kshenoy opened 11 years ago

kshenoy commented 11 years ago

vi( correctly seeks forward to the next parentheses pair and selects the text between them. However, di( doesn't delete the text between them.

paradigm commented 11 years ago

Sorry it took me so long to get back to you >.<

Could you provide an example buffer contents / starting cursor position where this happens?

kshenoy commented 10 years ago

Holy shit, I just saw this now :(

Anyway, take any sort of text. This is the sample text I was using

Lorem ipsum dolor [s]it amet,( consetetur sadipscing elitr ), sed diam nonumy eirmod

where [ indicates the position of the cursor. As mentioned above, vi( correctly selects the text between the braces but di( doesn't delete it

paradigm commented 10 years ago

At this point I'm likely going to end up doing a full rewrite from the ground up when I get the chance which should take care of this and a number of other issues. May take me a bit to get to it, though :

kshenoy commented 10 years ago

Ok, no problem. Would it be too difficult to add support for custom next/prev mappings as shown [here]?(https://gist.github.com/kshenoy/4698889)

Basically, instead of automatically searching for the next parentheses and operating on them as we're doing now, you can specify whether to look ahead or behind.

paradigm commented 10 years ago

If I understood your request correctly, TextObjectify (is supposed to) already support that by setting the 'seek' value for the given mapping. That's one of the main things I use TextObjectify for, actually. See ":help textobjectify-configuration" and note the "seek" bullet point.