aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua2
-rw-r--r--util.lua5
2 files changed, 4 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 0cbbe99..3674990 100644
--- a/init.lua
+++ b/init.lua
@@ -1262,7 +1262,7 @@ end
local function find_root_uri(ls, file_path)
local globs = ''
- local roots = ls.conf.roots
+ local roots = ls.roots
if roots then
for _, glob in ipairs(roots) do
globs = globs .. glob .. '\n'
diff --git a/util.lua b/util.lua
index de5ad07..a8ca1be 100644
--- a/util.lua
+++ b/util.lua
@@ -195,9 +195,10 @@ end
-- @param globs a new line separated string of file globs
-- @param start the starting path
function util.find_upwards(globs, start)
- local status, out = vis:pipe(globs, source_path .. '/tools/find-upwards "' .. start .. '"')
+ local status, out = util.vis_pipe(globs, '\'' .. source_path:gsub('\'', '\'\\\'\'') ..
+ '/tools/find-upwards\' "' .. start .. '"')
- if status ~= 0 then
+ if status ~= 0 or out == nil then
return nil
end