From dfea25aae81711df9d05545a3b17247b1c12a6f7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 14 Mar 2012 09:23:25 -0400 Subject: [PATCH] Fix `.` after a `ys` map Closes #54. --- plugin/surround.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/surround.vim b/plugin/surround.vim index 846e838..c80847e 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -509,6 +509,8 @@ function! s:opfunc(type,...) " {{{1 let &clipboard = cb_save if a:type =~ '^\d\+$' silent! call repeat#set("\Y".(a:0 && a:1 ? "S" : "s")."surround".char.s:tag,a:type) + else + silent! call repeat#set("\Yrepeat".char.s:tag,a:type) endif endfunction @@ -539,6 +541,7 @@ nnoremap YSsurround :call opfunc2(v:count1) " discards the numerical argument but there's not much we can do with it nnoremap Ysurround :set opfunc=opfuncg@ nnoremap YSurround :set opfunc=opfunc2g@ +nnoremap Yrepeat :execute 'normal! .'.inputtarget() vnoremap VSurround :call opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0) vnoremap VgSurround :call opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1) inoremap Isurround =insert()