preservim / vim-textobj-quote

Use ‘curly’ quote characters in Vim
Other
123 stars 6 forks source link

Why can't I change surrounding pairs from curly quotes to other? #9

Closed alerque closed 8 years ago

alerque commented 8 years ago

I use vim-surround for manipulating matching pairs of quotes and other syntax. Adding vim-textobj-quote to the mix works great for getting motion commands for curly quoted strings. It also works out of the box to add a surround operator for curly quotes. Changing other surround symbols to curly quotes even works: using "this‸ string", typing cs"q will produce “this‸ string”. The issue I have is that it doesn't work the other direction: starting with “this‸ string” and typing csq" does nothing.

What's going on here? Is this a bug or do I have something setup wrong?

reedes commented 8 years ago

It's been a long time since I was last in this code, but I'd speculate that you can't go backwards because vim-surround doesn't associate q with the curly quotes.

Sorry, but I won't have a chance to dig into this anytime soon, but if you can come up with a solution, I'd happily accept a pull request.

alerque commented 8 years ago

This appears to be a problem with vim-surround and I have come up with a fix that makes it work with the text object defined by this plugin. If it turns out that's not the right fix and there is something do do on this end I'll re-open this issue.