Skip to content

Commit

Permalink
fix(signature): safer lsp signature parameters (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
hackeryarn authored May 2, 2023
1 parent 0f12ed3 commit e33c346
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/noice/lsp/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ function M:active_parameter(sig_index)
return
end
local sig = self.signatures[sig_index]
if sig.activeParameter and sig.parameters[sig.activeParameter + 1] then
if sig.activeParameter and sig.parameters and sig.parameters[sig.activeParameter + 1] then
return sig.parameters[sig.activeParameter + 1]
end
if self.activeParameter and sig.parameters[self.activeParameter + 1] then
if self.activeParameter and sig.parameters and sig.parameters[self.activeParameter + 1] then
return sig.parameters[self.activeParameter + 1]
end
return sig.parameters and sig.parameters[1] or nil
Expand Down

0 comments on commit e33c346

Please sign in to comment.