diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-10 00:23:48 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-10 00:23:48 +0900 |
commit | de68f3a138d460f84dc80b92a331e88f94d12e7c (patch) | |
tree | d47aa7eb2729a38fc32421b60ac2d127e5ffb146 | |
parent | 58e3eb39dd676783037a316130d7a9651ea3b1e4 (diff) | |
download | vim-lsp-settings-de68f3a138d460f84dc80b92a331e88f94d12e7c.tar.gz vim-lsp-settings-de68f3a138d460f84dc80b92a331e88f94d12e7c.tar.bz2 vim-lsp-settings-de68f3a138d460f84dc80b92a331e88f94d12e7c.zip |
Cosmetic changes
-rw-r--r-- | autoload/lsp_settings.vim | 36 | ||||
-rw-r--r-- | plugin/lsp_settings.vim | 14 |
2 files changed, 17 insertions, 33 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index 18636f0..6d4c28d 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -47,18 +47,12 @@ function! lsp_settings#exec_path(cmd) abort return s:first_one(l:path) endif else - let l:path = globpath(l:paths, l:cmd . '.exe') - if !empty(l:path) - return s:first_one(l:path) - endif - let l:path = globpath(l:paths, l:cmd . '.cmd') - if !empty(l:path) - return s:first_one(l:path) - endif - let l:path = globpath(l:paths, l:cmd . '.bat') - if !empty(l:path) - return s:first_one(l:path) - endif + for l:ext in ['.exe', '.cmd', '.bat'] + let l:path = globpath(l:paths, l:cmd . l:ext) + if !empty(l:path) + return s:first_one(l:path) + endif + endfor endif let l:paths = get(g:, 'lsp_settings_extra_paths', '') @@ -70,18 +64,12 @@ function! lsp_settings#exec_path(cmd) abort if !has('win32') return s:first_one(globpath(l:paths, l:cmd)) endif - let l:path = globpath(l:paths, l:cmd . '.exe') - if !empty(l:path) - return s:first_one(l:path) - endif - let l:path = globpath(l:paths, l:cmd . '.cmd') - if !empty(l:path) - return s:first_one(l:path) - endif - let l:path = globpath(l:paths, l:cmd . '.bat') - if !empty(l:path) - return s:first_one(l:path) - endif + for l:ext in ['.exe', '.cmd', '.bat'] + let l:path = globpath(l:paths, l:cmd . l:ext) + if !empty(l:path) + return s:first_one(l:path) + endif + endfor return '' endfunction diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim index f8df1df..350c9ce 100644 --- a/plugin/lsp_settings.vim +++ b/plugin/lsp_settings.vim @@ -21,15 +21,11 @@ function! s:executable(cmd) abort if !has('win32') return !empty(globpath(l:paths, a:cmd)) endif - if !empty(globpath(l:paths, a:cmd . '.exe')) - return 1 - endif - if !empty(globpath(l:paths, a:cmd . '.cmd')) - return 1 - endif - if !empty(globpath(l:paths, a:cmd . '.bat')) - return 1 - endif + for l:ext in ['.exe', '.cmd', '.bat'] + if !empty(globpath(l:paths, a:cmd . l:ext)) + return 1 + endif + endfor return 0 endfunction |