fix(preview): Empty symbol preview

Fix simrat39/symbols-outline.nvim#176

I was going to pull @enddeadroyal's commit from their
'bugfix/symbol-hover-misplacement' branch in their fork but they changed
indentation so I had to apply the relevant changes myself instead.

However, credits for this fix goes to @enddeadroyal from the issue
commit in 176.

Also fixed the "No info available" markdown as it wasn't rendering
properly for me without a space after the '###'.
This commit is contained in:
hedy
2023-11-01 15:33:26 +08:00
parent d2f0a4af6a
commit f7fc1905a4
2 changed files with 3 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ end
local function get_hovered_node()
local hovered_line = vim.api.nvim_win_get_cursor(so.view.winnr)[1]
local node = so.state.outline_items[hovered_line]
local node = so.state.flattened_outline_items[hovered_line]
return node
end
@@ -126,7 +126,7 @@ local function update_hover()
end
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
if vim.tbl_isempty(markdown_lines) then
markdown_lines = { '###No info available!' }
markdown_lines = { '### No info available!' }
end
markdown_lines = vim.lsp.util.stylize_markdown(