Skip to content

Commit

Permalink
issue #94 async cleanup virtual text
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Sep 24, 2021
1 parent 99a8112 commit 7c0071b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lua/lsp_signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ local signature_handler = helper.mk_handler(function(err, result, ctx, config)
if not (result and result.signatures and result.signatures[1]) then
-- only close if this client opened the signature
if _LSP_SIG_CFG.client_id == client_id then
helper.cleanup(true)
helper.cleanup_async(true, 0.1)

-- need to close floating window and virtual text (if they are active)
end
Expand Down Expand Up @@ -351,7 +351,7 @@ local signature_handler = helper.mk_handler(function(err, result, ctx, config)
vim.api.nvim_win_set_option(_LSP_SIG_CFG.winnr, "winblend", _LSP_SIG_CFG.transpancy)
end
local sig = result.signatures
-- if it is last parameter, close windows after cursor moved<F2>
-- if it is last parameter, close windows after cursor moved
if sig and sig[activeSignature].parameters == nil or result.activeParameter == nil
or result.activeParameter + 1 == #sig[activeSignature].parameters then
-- log("last para", close_events)
Expand Down Expand Up @@ -448,7 +448,7 @@ function M.on_InsertLeave()
manager.timer = nil
end
log('Insert leave cleanup')
helper.cleanup(true)
helper.cleanup_async(true, 0.3) -- defer close after 0.3s
end

local start_watch_changes_timer = function()
Expand Down
2 changes: 1 addition & 1 deletion lua/lsp_signature_helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ helper.match_parameter = function(result, config)

if activeParameter == nil or activeParameter < 0 then
log("incorrect signature response?", result, config)
activeParameter = helper.fallback(config.triggered_chars or {'('})
activeParameter = helper.fallback(config.triggered_chars or {'(', ','})
end
if signature.parameters == nil then
log("incorrect signature response?", result)
Expand Down

0 comments on commit 7c0071b

Please sign in to comment.