Skip to content

Commit

Permalink
bug: ignore byte results
Browse files Browse the repository at this point in the history
fix #21
  • Loading branch information
lukas-reineke committed Dec 2, 2021
1 parent a9e6c96 commit 4c3f5f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/cmp-rg/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ source.complete = function(self, request, callback)
for _, entry in ipairs(data) do
if entry ~= "" then
local ok, result = pcall(self.json_decode, entry)
if not ok or result.type == "end" then
if
not ok
or result.type == "end"
or (vim.tbl_contains({ "context", "match" }, result.type) and not result.data.lines.text)
then
context = {}
documentation_to_add = 0
elseif result.type == "context" then
Expand Down

0 comments on commit 4c3f5f5

Please sign in to comment.