From 3482aea5ba346df593f41a2e327911d2e48477fe Mon Sep 17 00:00:00 2001 From: Alex Padgett Date: Fri, 2 Mar 2012 09:20:22 -0500 Subject: [PATCH 1/4] Add support for tag repeat --- plugin/surround.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/surround.vim b/plugin/surround.vim index 71da7a1..8eee147 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -178,8 +178,10 @@ function! s:wrap(string,char,type,...) if dounmapb silent! cunmap > endif + let s:tag = tag if tag != "" let tag = substitute(tag,'>*$','','') + let s:tag = tag . '>' let before = '<'.tag.'>' if tag =~ '/$' let after = '' From 09fd529c7acf02120c8ca2efd20dc6f4cfcd5e79 Mon Sep 17 00:00:00 2001 From: Alex Padgett Date: Fri, 2 Mar 2012 09:45:03 -0500 Subject: [PATCH 2/4] Add tag to the end of repeat message --- plugin/surround.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index 8eee147..c28ed76 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -507,7 +507,7 @@ function! s:opfunc(type,...) " {{{1 let &selection = sel_save let &clipboard = cb_save if a:type =~ '^\d\+$' - silent! call repeat#set("\Y".(a:0 && a:1 ? "S" : "s")."surround".char,a:type) + silent! call repeat#set("\Y".(a:0 && a:1 ? "S" : "s")."surround".char.s:tag,a:type) endif endfunction From b8b7ed84eed4cf1bc773191e974ca7071b3c9000 Mon Sep 17 00:00:00 2001 From: Alex Padgett Date: Fri, 2 Mar 2012 10:24:19 -0500 Subject: [PATCH 3/4] Clear s:tag before starting wrap function --- plugin/surround.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/surround.vim b/plugin/surround.vim index c28ed76..0810a16 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -127,6 +127,7 @@ endfunction function! s:wrap(string,char,type,...) let keeper = a:string let newchar = a:char + let s:tag = "" let type = a:type let linemode = type ==# 'V' ? 1 : 0 let special = a:0 ? a:1 : 0 From 25f59364dbfe9178b785b810ac83e5a1e750b3b5 Mon Sep 17 00:00:00 2001 From: Alex Padgett Date: Fri, 2 Mar 2012 10:29:25 -0500 Subject: [PATCH 4/4] Enable repeat with tags for cst --- plugin/surround.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index 0810a16..fd49268 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -435,7 +435,7 @@ function! s:dosurround(...) " {{{1 if newchar == "" silent! call repeat#set("\Dsurround".char,scount) else - silent! call repeat#set("\Csurround".char.newchar,scount) + silent! call repeat#set("\Csurround".char.newchar.s:tag,scount) endif endfunction " }}}1