Contract selection doesn't work with "begin rescue end" block. #8

Open
jdguyot opened this Issue Feb 27, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@jdguyot

jdguyot commented Feb 27, 2011

Say you have this type of block:

def method
  begin
    puts "Yeah"
  rescue Exception => e
    puts e
  end
end

Select the puts "Yeah" code with vir, then select the begin rescue end block with ar. If you want to get back to the included block with ir, it doesn't select anything.

I know there is a decision to make between begin and rescue included lines of code. By default it could be the first one, and maybe one could remind from where the user came when he did ar. Or maybe use another command.

I discovered your project yesterday so I'm a total newbie with this for now, there may be already a good way to do this but I didn't find it.

@sorin-ionescu

This comment has been minimized.

Show comment Hide comment
@sorin-ionescu

sorin-ionescu Apr 22, 2011

If you place your cursor on begin, and hit %, it jumps to rescue, then end, then back to begin. matchit.vim might be confusing vim-textobj-rubyblock. I would like to see a fix for this as well.

If you place your cursor on begin, and hit %, it jumps to rescue, then end, then back to begin. matchit.vim might be confusing vim-textobj-rubyblock. I would like to see a fix for this as well.

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