Skip to content

Commit

Permalink
Merge pull request #627 from ckipp01/decorationHover
Browse files Browse the repository at this point in the history
fix: check for the existence of hoverMessage before using
  • Loading branch information
ckipp01 authored Nov 16, 2023
2 parents 96d0c8d + cbe4224 commit a3a75d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/metals/decoration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ M.set_decoration = function(bufnr, decoration)
local virt_text_opts = { virt_text = virt_texts, hl_mode = "combine" }
local ext_id = api.nvim_buf_set_extmark(bufnr, M.decoration_namespace(), line, -1, virt_text_opts)

local hover_message = lsp.util.convert_input_to_markdown_lines(decoration.hoverMessage, {})
hover_message = lsp.util.trim_empty_lines(hover_message)
if decoration.hoverMessage then
local hover_message = lsp.util.convert_input_to_markdown_lines(decoration.hoverMessage, {})
hover_message = lsp.util.trim_empty_lines(hover_message)

hover_messages[ext_id] = hover_message
hover_messages[ext_id] = hover_message
end
end

M.hover_worksheet = function(opts)
Expand Down

0 comments on commit a3a75d0

Please sign in to comment.