mirror of
https://github.com/tpope/vim-sensible.git
synced 2025-11-11 04:23:47 -05:00
Favor execute() over :redir, for performance
Resolves: https://github.com/tpope/vim-sensible/issues/186
This commit is contained in:
@@ -21,9 +21,13 @@ endif
|
||||
" overriding options in the user's vimrc, but still override options in the
|
||||
" system vimrc.
|
||||
function! s:MaySet(option) abort
|
||||
redir => out
|
||||
silent verbose execute 'setglobal all' a:option . '?'
|
||||
redir END
|
||||
if exists('*execute')
|
||||
let out = execute('verbose setglobal all ' . a:option . '?')
|
||||
else
|
||||
redir => out
|
||||
silent verbose execute 'setglobal all' a:option . '?'
|
||||
redir END
|
||||
endif
|
||||
return out !~# " \\~[\\/][^\n]*$"
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user