benmccormick/vim-mode — pull request #1 by benmccormick (2014-10-14 02:47:45+00:00)
Title: Improved Quote Text Objects

This is a first stab at fixing the issues I raised in #379. Commands like
`ci'` and `ca"` now behave as expected when outside of a string.

I've updated the tests to check for the right behavior and wrote an initial implementation.
Unfortunately my first take is pretty hopelessly naive.
I'm iterating all the way back through the file to count quote marks to tell if I'm inside
a quote or between 2 strings. I'd love feedback from somebody with a better
knowledge of Atom internals/APIs about what I can do better to avoid running up the whole file,
there's a noticeable lag when using these text objects at the end of large files right now.

Clumping up the whole earlier text into a string, removing escaped quotes and filtering other characters
would probably be more efficient but still slow. I'd love any feedback from Atom experts on how to make this better.