diff options
author | mattn <mattn.jp@gmail.com> | 2020-01-06 11:53:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-06 11:53:27 +0900 |
commit | 5323921211dfd7465f001e30f1e379d452a7542e (patch) | |
tree | a8c9e05b15aaec6cccaf18e08ce5e124aaa4ff56 | |
parent | 6d949ce6ce9ed6a0feb1024edada76bd411498b3 (diff) | |
parent | 1d5dbefdf6fcbe1e90431ccb634827bb347cc3dd (diff) | |
download | vim-lsp-settings-5323921211dfd7465f001e30f1e379d452a7542e.tar.gz vim-lsp-settings-5323921211dfd7465f001e30f1e379d452a7542e.tar.bz2 vim-lsp-settings-5323921211dfd7465f001e30f1e379d452a7542e.zip |
Merge pull request #66 from prabirshrestha/windows-trailing-slash
fix globpath so it removes trailing slash if it exists on windows
-rw-r--r-- | autoload/lsp_settings.vim | 15 |
1 files 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) |