Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

textobj-rubyblock-a selects only the first line #3

Closed
meqif opened this Issue · 3 comments

3 participants

@meqif

I installed both textobj-user and textobj-rubyblock (HEAD == 6739e4a) via pathogen but can't get reproduce the first example described at http://vimcasts.org/blog/2010/12/a-text-object-for-ruby-blocks/.

The cursor was over def, I typed var in normal mode to select the whole method definition but only the current line is selected, as shown here.

I also tried the other examples in the blog post with no success.

On the other hand, textobj-indent works just fine.

I can reproduce this bug in both MacVim 7.3 (53) (both in the GUI and terminal mode) and Snow Leopard's vim 7.2 (108).

Here's a sample file: https://gist.github.com/756312 (don't mind the nasty code).

@telemachus

I believe the problem is your indentation (which appears to be 4 spaces rather than 2). I'm not yet sure if the it comes from textobj-rubyblock or textobj-user (which rubyblock builds on), but something is very sensitive to indentation/spacing.

After I reformatted your code to have 2 space indentations, it worked fine. See here if you want to experiment: https://gist.github.com/756745

@meqif

Actually, the problem had a completely different cause: there is an additional dependency which @nelstrom overlooked — matchit.vim. He mentioned it here.

After I added runtime macros/matchit.vim to my vimrc, the plugin started working correctly (except for the parser method, which var handles correctly but vir or successive irs and ars behave incorrectly, but that's for another issue).

In any case, thanks for your help, I truly appreciate it. :-)

Since this was actually a non-issue, I apologize for taking people's time and I'll close this.

@nelstrom
Owner

No need to apologize, this was not a non-issue. You made me realise that my plugin was dependent on matchit.vim, so thanks for raising it.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.