mirror of
https://github.com/tpope/vim-surround.git
synced 2025-11-12 21:33:50 -05:00
Alphabetic characters won't insert themselves
This commit is contained in:
@@ -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')
|
||||||
|
|||||||
Reference in New Issue
Block a user