mirror of
https://github.com/neovim/neovim.git
synced 2025-11-07 03:04:22 +00:00
provider/lang: expand() g:foo_host_prog (#9312)
Before this commit, if user does this:
let g:node_host_prog = '~/.nvm/versions/node/v11.3.0/bin/neovim-node-host'
the "~/" is not expanded to user's home directory.
`:help g:ruby_host_prog` suggests a path with "~/" so technically we
already claimed to support this.
closes https://github.com/neovim/node-client/issues/102
This commit is contained in:
@@ -49,7 +49,7 @@ endfunction
|
|||||||
|
|
||||||
function! provider#node#Detect() abort
|
function! provider#node#Detect() abort
|
||||||
if exists('g:node_host_prog')
|
if exists('g:node_host_prog')
|
||||||
return g:node_host_prog
|
return expand(g:node_host_prog)
|
||||||
endif
|
endif
|
||||||
if !s:is_minimum_version(v:null, 6, 0)
|
if !s:is_minimum_version(v:null, 6, 0)
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ endfunction
|
|||||||
function! provider#pythonx#Detect(major_ver) abort
|
function! provider#pythonx#Detect(major_ver) abort
|
||||||
if a:major_ver == 2
|
if a:major_ver == 2
|
||||||
if exists('g:python_host_prog')
|
if exists('g:python_host_prog')
|
||||||
return [g:python_host_prog, '']
|
return [expand(g:python_host_prog), '']
|
||||||
else
|
else
|
||||||
let progs = ['python2', 'python2.7', 'python2.6', 'python']
|
let progs = ['python2', 'python2.7', 'python2.6', 'python']
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if exists('g:python3_host_prog')
|
if exists('g:python3_host_prog')
|
||||||
return [g:python3_host_prog, '']
|
return [expand(g:python3_host_prog), '']
|
||||||
else
|
else
|
||||||
let progs = ['python3', 'python3.7', 'python3.6', 'python3.5',
|
let progs = ['python3', 'python3.7', 'python3.6', 'python3.5',
|
||||||
\ 'python3.4', 'python3.3', 'python']
|
\ 'python3.4', 'python3.3', 'python']
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:detect()
|
function! s:detect()
|
||||||
if exists("g:ruby_host_prog")
|
if exists("g:ruby_host_prog")
|
||||||
return g:ruby_host_prog
|
return expand(g:ruby_host_prog)
|
||||||
elseif has('win32')
|
elseif has('win32')
|
||||||
return exepath('neovim-ruby-host.bat')
|
return exepath('neovim-ruby-host.bat')
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3379,9 +3379,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
|
|||||||
|
|
||||||
If {list} is given and it is |TRUE|, a List will be returned.
|
If {list} is given and it is |TRUE|, a List will be returned.
|
||||||
Otherwise the result is a String and when there are several
|
Otherwise the result is a String and when there are several
|
||||||
matches, they are separated by <NL> characters. [Note: in
|
matches, they are separated by <NL> characters.
|
||||||
version 5.0 a space was used, which caused problems when a
|
|
||||||
file name contains a space]
|
|
||||||
|
|
||||||
If the expansion fails, the result is an empty string. A name
|
If the expansion fails, the result is an empty string. A name
|
||||||
for a non-existing file is not included, unless {expr} does
|
for a non-existing file is not included, unless {expr} does
|
||||||
@@ -3442,7 +3440,7 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
|
|||||||
all "README" files in the current directory and below: >
|
all "README" files in the current directory and below: >
|
||||||
:echo expand("**/README")
|
:echo expand("**/README")
|
||||||
<
|
<
|
||||||
Expand() can also be used to expand variables and environment
|
expand() can also be used to expand variables and environment
|
||||||
variables that are only known in a shell. But this can be
|
variables that are only known in a shell. But this can be
|
||||||
slow, because a shell may be used to do the expansion. See
|
slow, because a shell may be used to do the expansion. See
|
||||||
|expr-env-expand|.
|
|expr-env-expand|.
|
||||||
|
|||||||
Reference in New Issue
Block a user