bugfix codeAction hint

neovim_0_5
ray-x 3 years ago
parent ec6cb6b025
commit 8c91e998f0

@ -26,7 +26,7 @@ function code_action.code_action_handler(err, _, actions, cid, bufnr, _, customS
local function apply_action(idx)
local action_chosen = actions[idx - 1]
local switch = string.format('silent b %d', bufnr)
local switch = string.format("silent b %d", bufnr)
if action_chosen.edit or type(action_chosen.command) == "table" then
if action_chosen.edit then
vim.lsp.util.apply_workspace_edit(action_chosen.edit)
@ -108,7 +108,10 @@ end
local function _update_sign(line)
local winid = get_current_winid()
if code_action[winid] and code_action[winid].lightbulb_line ~= 0 then
if code_action[winid] == nil then
code_action[winid] = {}
end
if code_action[winid].lightbulb_line ~= 0 then
vim.fn.sign_unplace(sign_group, {id = code_action[winid].lightbulb_line, buffer = "%"})
end

@ -16,31 +16,6 @@ function M.add_highlight()
api.nvim_command("hi! link LspDiagnosticsUnderlineWarning SpellRare")
api.nvim_command("hi! link LspDiagnosticsUnderlineInformation SpellRare")
api.nvim_command("hi! link LspDiagnosticsUnderlineHint SpellRare")
-- lspsaga
api.nvim_command("hi LspFloatWinBorder guifg=black")
api.nvim_command("hi def link TargetWord Error")
api.nvim_command("hi def link ReferencesCount Title")
api.nvim_command("hi def link DefinitionCount Title")
api.nvim_command("hi def link TargetFileName Comment")
api.nvim_command("hi def link DefinitionIcon Special")
api.nvim_command("hi def link ReferencesIcon Special")
api.nvim_command("hi def link HelpTitle Comment")
api.nvim_command("hi def link HelpItem Comment")
-- diagnostic for lspsaga, overwrite if needed
-- api.nvim_command("hi DiagnosticTruncateLine guifg=#6699cc gui=bold")
-- api.nvim_command("hi def link DiagnosticError Error")
-- api.nvim_command("hi def link DiagnosticWarning WarningMsg")
-- api.nvim_command("hi DiagnosticInformation guifg=#6699cc gui=bold")
-- api.nvim_command("hi DiagnosticHint guifg=#56b6c2 gui=bold")
-- for nvim version 0.5 2020-11
-- api.nvim_command("sign define LspDiagnosticsErrorSign text= texthl=LspDiagnosticsError linehl= numhl=")
-- api.nvim_command("sign define LspDiagnosticsWarningSign text= texthl=LspDiagnosticsWarning linehl= numhl=")
api.nvim_command("hi def link DefinitionPreviewTitle Title")
end

Loading…
Cancel
Save