RubyCursorIdentifier() fails to find ! and ? identifiers #68

Peeja opened this Issue Feb 10, 2012 · 3 comments

2 participants


Unless I'm missing something...

  1. In a Ruby file, enter:!
  2. Position the caret in the word bar! and press <C-]>.

  3. Vim tries to find the tag foo.
  4. Position the caret in the word quux! and press <C-]>.
  5. Vim tries to find the tag baz.

Incidentally, in my .vimrc, I have ?,! in my 'iskeyword' for Ruby files, so unmapping vim-ruby's <C-]> makes this work again. Would that not be a better approach for tags? It looks like RubyCursorIdentifier() is doing a lot of work to match literals, but I'd never want to tag those.

Vim-Ruby member

Changing 'iskeyword' breaks more than it fixes. Think ! before an identifier, for just one example. It would probably be possible to work around this in RubyCursorIdentifier(), but as that's only one of numerous breakages, I don't think it's worth it.

Adding support for other literals does add a few lines of complexity to RubyCursorIdentifier(), but as far as I'm concerned, it doesn't really hurt anything and it makes the function a more useful building block.

Other than tags, why are you changing 'iskeyword'?


For word-based motions and text objects: w and iw. That might be it, but it's important. Can those be built on top of RubyCursorIdentifier()?

I didn't realize that it was my 'iskeyword' that was breaking RubyCursorIdentifier() in the first place. I'd love to find another way to fix w and iw.

Vim-Ruby member

It would certainly be possible to remap w and iw, but I'm guessing it would be quite a bit more complicated than just a wrapper around RubyCursorIdentifier().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment