mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
providers: Disable if g:loaded_*
exists.
The exists('g:loaded_foo') convention is rather common, and may be relied upon in some cases. It's also very unlikely that a user or plugin has any reason to set g:loaded_foo to zero, so the principle of least surprise can be brushed aside here. https://github.com/neovim/neovim/issues/6107#issuecomment-279532143
This commit is contained in:
parent
9451647d9b
commit
2f38ed11c9
@ -226,12 +226,12 @@ function! s:check_python(version) abort
|
|||||||
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
|
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
|
||||||
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
||||||
let host_prog_var = pyname.'_host_prog'
|
let host_prog_var = pyname.'_host_prog'
|
||||||
let loaded_var = 'loaded_'.pyname.'_provider'
|
let loaded_var = 'g:loaded_'.pyname.'_provider'
|
||||||
let python_bin = ''
|
let python_bin = ''
|
||||||
let python_multiple = []
|
let python_multiple = []
|
||||||
|
|
||||||
if get(g:, loaded_var, 0) && !exists('*provider#'.pyname.'#Call')
|
if exists(loaded_var) && !exists('*provider#'.pyname.'#Call')
|
||||||
call health#report_info('Disabled. g:'.loaded_var.'='.get(g:, loaded_var, 0))
|
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -415,9 +415,9 @@ endfunction
|
|||||||
function! s:check_ruby() abort
|
function! s:check_ruby() abort
|
||||||
call health#report_start('Ruby provider')
|
call health#report_start('Ruby provider')
|
||||||
|
|
||||||
let loaded_var = 'loaded_ruby_provider'
|
let loaded_var = 'g:loaded_ruby_provider'
|
||||||
if get(g:, loaded_var, 0) && !exists('*provider#ruby#Call')
|
if exists(loaded_var) && !exists('*provider#ruby#Call')
|
||||||
call health#report_info('Disabled. g:'.loaded_var.'='.get(g:, loaded_var, 0))
|
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
" Associating the plugin with the Python host is the first step because plugins
|
" Associating the plugin with the Python host is the first step because plugins
|
||||||
" will be passed as command-line arguments
|
" will be passed as command-line arguments
|
||||||
|
|
||||||
if get(g:, 'loaded_python_provider', 0)
|
if exists('g:loaded_python_provider')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_python_provider = 1
|
let g:loaded_python_provider = 1
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
" Associating the plugin with the Python3 host is the first step because
|
" Associating the plugin with the Python3 host is the first step because
|
||||||
" plugins will be passed as command-line arguments
|
" plugins will be passed as command-line arguments
|
||||||
|
|
||||||
if get(g:, 'loaded_python3_provider', 0)
|
if exists('g:loaded_python3_provider')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_python3_provider = 1
|
let g:loaded_python3_provider = 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
" The Ruby provider helper
|
" The Ruby provider helper
|
||||||
if get(g:, 'loaded_ruby_provider', 0)
|
if exists('g:loaded_ruby_provider')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_ruby_provider = 1
|
let g:loaded_ruby_provider = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user