Skip to content

Commit

Permalink
Use normal! not normal
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Sep 13, 2011
1 parent f21c564 commit 9ca7280
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ftplugin/ruby.vim
Expand Up @@ -257,30 +257,30 @@ function! s:synname()
endfunction

function! s:wrap_i(back,forward)
execute 'norm k'.a:forward
execute 'normal! k'.a:forward
let line = line('.')
execute 'norm '.a:back
execute 'normal! '.a:back
if line('.') == line - 1
return s:wrap_a(a:back,a:forward)
endif
execute 'norm jV'.a:forward.'k'
execute 'normal! jV'.a:forward.'k'
endfunction

function! s:wrap_a(back,forward)
execute 'norm '.a:forward
execute 'normal! '.a:forward
if line('.') < line('$') && getline(line('.')+1) ==# ''
let after = 1
endif
execute 'norm '.a:back
execute 'normal! '.a:back
while getline(line('.')-1) =~# '^\s*#' && line('.')
-
endwhile
if exists('after')
execute 'norm V'.a:forward.'j'
execute 'normal! V'.a:forward.'j'
elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$'
execute 'norm kV'.a:forward
execute 'normal! kV'.a:forward
else
execute 'norm V'.a:forward
execute 'normal! V'.a:forward
endif
endfunction

Expand Down

0 comments on commit 9ca7280

Please sign in to comment.