paradigm / TextObjectify

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

TextObjectify breaks all 2-character mappings for text objects #9

Open mascip opened 10 years ago

mascip commented 10 years ago

Hi, I use CamelMotion and html-textobjects. These plugins define mappings with 2 characters for their text objects.

For example CamelMotion provides ,w in addition to w : you can do vi,w to select one camel case word. But when I do vi,w with TextObjectify, it selects the text between the two nearest commas. So I have stopped using TexTObjectify, which is a shame.

As a solution, I think I would like to be able to de-activate TextObjectify for given characters. Maybe by providing an additional optional argument in g:textobjectify, to indicate that the text object is de-activated? Or by providing an additional g:dontobjectify variable.

Did anyone have a similar problem? What do you think, for solutions?

paradigm commented 10 years ago

Interesting, I didn't consider multicharacter text-objects like that. Definately on me. The problem is that a key feature of TOify is that it will create text-objects on-the-fly as an undefined one is entered, and for this it assumes they're all one-character.

It should be possible for TOify to parse the existing mappings (with :redir and :map) to catch this situation now that I am aware that it is a possibility. It shouldn't require any additional g:settings.

It'll take me a bit to write up with my given schedule, sadly. I've got a major re-write of TOify incoming in (hopefully) the next few months. A lot of issues have been discovered with the current design of TOify, and it has become apparent that I need to take a completely different approach. My free-development time has been completely saturated with another higher-priority project. Once the other project's release is out, I'll go through and rewrite TOify, and I'll be sure to include this in the fixes.

So I'd currently recommend holding off on using TOify for now and check back early next year. My apologies.

mascip commented 10 years ago

Wow, thank you for your very thorough answer. Don't apologize you provide a great plugin!

Good luck with stuff, I hope you find time for yourself =)