Alphabetic characters won't insert themselves

This commit is contained in:
Tim Pope
2006-11-05 18:50:27 +00:00
parent f168e0d58c
commit dd236914cf

View File

@@ -132,9 +132,9 @@
" Replacements: *surround-replacements* " Replacements: *surround-replacements*
" "
" A replacement argument is a single character, and is required by |cs|, |ys|, " A replacement argument is a single character, and is required by |cs|, |ys|,
" and |vs|. Undefined replacement characters default to placing themselves at " and |vs|. Undefined replacement characters (with the exception of
" the beginning and end of the destination, which can be useful for characters " alphabetic characters) default to placing themselves at the beginning and
" like / and |. " end of the destination, which can be useful for characters like / and |.
" "
" If either ), }, ], or > is used, the text is wrapped in the appropriate " If either ), }, ], or > is used, the text is wrapped in the appropriate
" pair of characters. Similar behavior can be found with (, {, and [ (but not " pair of characters. Similar behavior can be found with (, {, and [ (but not
@@ -420,9 +420,12 @@ function! s:wrap(string,char,type,...)
let idx = idx / 3 * 3 let idx = idx / 3 * 3
let before = strpart(pairs,idx+1,1) . spc let before = strpart(pairs,idx+1,1) . spc
let after = spc . strpart(pairs,idx+2,1) let after = spc . strpart(pairs,idx+2,1)
else elseif newchar !~ '\a'
let before = newchar let before = newchar
let after = newchar let after = newchar
else
let before = ''
let after = ''
endif endif
"let before = substitute(before,'\n','\n'.initspaces,'g') "let before = substitute(before,'\n','\n'.initspaces,'g')
let after = substitute(after ,'\n','\n'.initspaces,'g') let after = substitute(after ,'\n','\n'.initspaces,'g')