From 4c3f5f58024d2a84e0734d4141301c2c5258222e Mon Sep 17 00:00:00 2001 From: Lukas Reineke Date: Thu, 2 Dec 2021 11:50:30 +0900 Subject: [PATCH] bug: ignore byte results fix #21 --- lua/cmp-rg/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/cmp-rg/init.lua b/lua/cmp-rg/init.lua index 630f996..a52e118 100644 --- a/lua/cmp-rg/init.lua +++ b/lua/cmp-rg/init.lua @@ -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