From 1d5dbefdf6fcbe1e90431ccb634827bb347cc3dd Mon Sep 17 00:00:00 2001 From: Prabir Date: Sun, 5 Jan 2020 17:36:04 -0800 Subject: fix globpath so it removes trailing slash if it exists --- autoload/lsp_settings.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index d59d4ed..d6ecd5e 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -28,8 +28,19 @@ function! lsp_settings#exec_path(cmd) abort let l:dir = len(l:s) >= 1 ? l:s[0] : '' let l:cmd = len(l:s) >= 2 ? l:s[1] : l:s[0] - let l:paths = split($PATH, has('win32') ? ';' : ':') - let l:paths = join(l:paths, ',') + let l:paths = [] + if has('win32') + for l:path in split($PATH, ';') + if l:path[len(l:path) - 1:] == "\\" + call add(l:paths, l:path[:len(l:path)-2]) + elseif !empty(l:path) + call add(l:paths, l:path) + endif + endfor + else + let l:path = split($PATH, ':') + endif + let l:paths = join(l:paths, ",") let l:path = globpath(l:paths, l:cmd) if !has('win32') if !empty(l:path) -- cgit v1.2.3-54-g00ecf