Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

#12 (lsp_finder) fix misplaced cursor #98

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lua/lspsaga/libs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,20 @@ function libs.result_isempty(res)
end
for _, v in pairs(res) do
if next(v) == nil then
return true
goto continue
end
if not v.result then
return true
goto continue
end
if next(v.result) == nil then
return true
goto continue
end
if next(v.result) ~= nil then
return false
end
::continue::
end
return false
return true
end

function libs.split_by_pathsep(text, start_pos)
Expand Down
2 changes: 1 addition & 1 deletion lua/lspsaga/provider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local send_request = function(timeout)
for i, response in ipairs(responses) do
if type(response) == "table" then
for _, res in pairs(response) do
if res.result then
if res.result and next(res.result) ~= nil then
coroutine.yield(res.result, i)
end
end
Expand Down