Skip to content

Commit

Permalink
fix: possible vim.NIL on diagnostics code
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 7, 2021
1 parent 7d67f34 commit 1faa347
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/trouble/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ function renderer.render_diagnostics(view, text, items)
-- text:render(diag.type, diag.type, " ")

if diag.source then text:render(diag.source, "Source") end
if diag.code then text:render("(" .. diag.code .. ")", "Code") end
if diag.code and diag.code ~= vim.NIL then
text:render("(" .. diag.code .. ")", "Code")
end

text:render(" ")

Expand Down

0 comments on commit 1faa347

Please sign in to comment.