mirror of
https://github.com/tpope/vim-surround.git
synced 2026-09-10 07:16:17 -04:00
Merge e8980004f7 into 3d188ed211
This commit is contained in:
commit
dd7ba89d1c
|
|
@ -77,6 +77,9 @@ support:
|
|||
Only the opening brackets—`[`, `{`, and `(`—add a space. Use a closing
|
||||
bracket, or the `b` (`(`) and `B` (`{`) aliases.
|
||||
|
||||
Alternatively, to _completely disable_ adding of spaces (even with opening
|
||||
brackets) - then one may set `let g:surround_insert_space = 0`.
|
||||
|
||||
## Contributing
|
||||
|
||||
See the contribution guidelines for
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ if exists("g:loaded_surround") || &cp || v:version < 700
|
|||
finish
|
||||
endif
|
||||
let g:loaded_surround = 1
|
||||
let g:surround_insert_space = get(g:, 'surround_insert_space', 1)
|
||||
|
||||
" Input functions {{{1
|
||||
|
||||
|
|
@ -237,7 +238,7 @@ function! s:wrap(string,char,type,removed,special)
|
|||
let before = '('.fnc.' '
|
||||
let after = ')'
|
||||
elseif idx >= 0
|
||||
let spc = (idx % 3) == 1 ? " " : ""
|
||||
let spc = (idx % 3) == 1 && g:surround_insert_space ? " " : ""
|
||||
let idx = idx / 3 * 3
|
||||
let before = strpart(pairs,idx+1,1) . spc
|
||||
let after = spc . strpart(pairs,idx+2,1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue