From aef51cc696540e87979511a0bd5bb8227b22cadb Mon Sep 17 00:00:00 2001 From: ray-x Date: Mon, 23 Aug 2021 12:56:59 +1000 Subject: [PATCH] allow config codelens icon --- lua/navigator/codelens.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/navigator/codelens.lua b/lua/navigator/codelens.lua index 703dcf4..f73d9d4 100644 --- a/lua/navigator/codelens.lua +++ b/lua/navigator/codelens.lua @@ -73,7 +73,10 @@ end M.lsp_clients = {} function M.refresh() - assert(#vim.lsp.buf_get_clients() > 0, "Must have a client running to use lsp code action") + if #vim.lsp.buf_get_clients() < 1 then + log("Must have a client running to use lsp code action") + return + end if not lsphelper.check_capabilities("code_lens") then return end @@ -97,7 +100,9 @@ function M.run_action() end local width = 40 - local data = {"  CodeLens Action Apply Exit"} + local data = { + " " .. _NgConfigValues.icons.code_lens_action_icon .. " CodeLens Action Apply Exit" + } local idx = 1 for i, lens in pairs(lenses) do if lens.range.start.line == (line - 1) then