Fix . after a ys map

Closes #54.
This commit is contained in:
Tim Pope 2012-03-14 09:23:25 -04:00
parent efc017dcb4
commit dfea25aae8

View File

@ -509,6 +509,8 @@ function! s:opfunc(type,...) " {{{1
let &clipboard = cb_save
if a:type =~ '^\d\+$'
silent! call repeat#set("\<Plug>Y".(a:0 && a:1 ? "S" : "s")."surround".char.s:tag,a:type)
else
silent! call repeat#set("\<Plug>Yrepeat".char.s:tag,a:type)
endif
endfunction
@ -539,6 +541,7 @@ nnoremap <silent> <Plug>YSsurround :<C-U>call <SID>opfunc2(v:count1)<CR>
" <C-U> discards the numerical argument but there's not much we can do with it
nnoremap <silent> <Plug>Ysurround :<C-U>set opfunc=<SID>opfunc<CR>g@
nnoremap <silent> <Plug>YSurround :<C-U>set opfunc=<SID>opfunc2<CR>g@
nnoremap <silent> <Plug>Yrepeat :<C-U>execute 'normal! .'.<SID>inputtarget()<CR>
vnoremap <silent> <Plug>VSurround :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0)<CR>
vnoremap <silent> <Plug>VgSurround :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1)<CR>
inoremap <silent> <Plug>Isurround <C-R>=<SID>insert()<CR>