aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua8
-rw-r--r--util.lua2
2 files changed, 5 insertions, 5 deletions
diff --git a/init.lua b/init.lua
index 6d9568c..b8986a4 100644
--- a/init.lua
+++ b/init.lua
@@ -708,7 +708,7 @@ function LanguageServer:call_text_document_method(method, params, win, ctx)
end
local function lspc_handle_goto_method_response(req, result)
- if not result or next(result) == nil then
+ if not result or type(result) ~= 'table' or next(result) == nil then
lspc:warn(req.method .. ' found no results')
return
end
@@ -755,7 +755,7 @@ local function lspc_handle_goto_method_response(req, result)
end
local function lspc_handle_completion_method_response(win, result, old_pos)
- if not result or not result.items then
+ if not result or type(result) ~= 'table' or not result.items then
lspc:warn('no completion available')
return
end
@@ -843,7 +843,7 @@ local function lspc_handle_completion_method_response(win, result, old_pos)
end
local function lspc_handle_hover_method_response(win, result, old_pos)
- if not result or not result.contents then
+ if not result or type(result) ~= 'table' or not result.contents then
lspc:warn('no hover available')
return
end
@@ -877,7 +877,7 @@ local function lspc_handle_hover_method_response(win, result, old_pos)
end
local function lspc_handle_signature_help_method_response(win, result, call_pos)
- if not result or not result.signatures or #result.signatures == 0 then
+ if not result or type(result) ~= 'table' or not result.signatures or #result.signatures == 0 then
lspc:warn('no signature help available')
return
end
diff --git a/util.lua b/util.lua
index 076882d..04855fb 100644
--- a/util.lua
+++ b/util.lua
@@ -31,7 +31,7 @@ function util.capture_cmd(cmd)
return s
end
-local vis_supports_pipe_buf = pcall(vis.pipe, vis, 'foo', 'true')
+local vis_supports_pipe_buf = pcall(vis.pipe, vis, 'foo', 'true', false)
--- Wrapper for the two vis:pipe variants.
-- If vis does not support vis:pipe(input, cmd), prefix the command