Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
meqif opened this Issue Dec 27, 2010 · 3 comments

Comments

Projects
None yet
3 participants

meqif commented Dec 27, 2010

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).

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 commented Dec 28, 2010

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.

Owner

nelstrom commented Dec 28, 2010

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