mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Escape path before findfile or finddir (#1444)
This commit is contained in:
@@ -197,7 +197,7 @@ endfunction
|
||||
|
||||
" Find a nearest to a `path` parent directory `directoryname` by traversing the filesystem upwards
|
||||
function! lsp#utils#find_nearest_parent_directory(path, directoryname) abort
|
||||
let l:relative_path = finddir(a:directoryname, a:path . ';')
|
||||
let l:relative_path = finddir(a:directoryname, fnameescape(a:path) . ';')
|
||||
|
||||
if !empty(l:relative_path)
|
||||
return fnamemodify(l:relative_path, ':p')
|
||||
@@ -208,7 +208,7 @@ endfunction
|
||||
|
||||
" Find a nearest to a `path` parent filename `filename` by traversing the filesystem upwards
|
||||
function! lsp#utils#find_nearest_parent_file(path, filename) abort
|
||||
let l:relative_path = findfile(a:filename, a:path . ';')
|
||||
let l:relative_path = findfile(a:filename, fnameescape(a:path) . ';')
|
||||
|
||||
if !empty(l:relative_path)
|
||||
return fnamemodify(l:relative_path, ':p')
|
||||
|
||||
Reference in New Issue
Block a user