Skip to content

Commit

Permalink
Switch from 'search' to 'searchpair'.
Browse files Browse the repository at this point in the history
The searchpair method does everything I need! No need to implement a
stack-search.
  • Loading branch information
nelstrom committed Nov 20, 2010
1 parent 4ef6474 commit ef0599c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vim/bundle/textobj-rubyblock/plugin/textobj/rubyblock.vim
Expand Up @@ -13,7 +13,7 @@ call textobj#user#plugin('rubyblock', {

" Misc. "{{{1
function! s:select_a()
call search('\v^[^#]*\zs<end>', 'cW')
call searchpair('\v^[^#]*\zs(<if>|<do>|<module>|<class>)','','\v^[^#]*\zs<end>', 'cW')
let end_pos = getpos('.')

normal %
Expand All @@ -23,7 +23,7 @@ function! s:select_a()
endfunction

function! s:select_i()
call search('\v^[^#]*\zs<end>', 'cW')
call searchpair('\v^[^#]*\zs(<if>|<do>|<module>|<class>)','','\v^[^#]*\zs<end>', 'cW')
let end_pos = getpos('.')
let end_pos[1] = end_pos[1] - 1

Expand Down

0 comments on commit ef0599c

Please sign in to comment.