From de68f3a138d460f84dc80b92a331e88f94d12e7c Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 10 Jan 2020 00:23:48 +0900 Subject: Cosmetic changes --- autoload/lsp_settings.vim | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'autoload') 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 -- cgit v1.2.3-54-g00ecf