fix: use api.nvim_buf_get_lines instead of fn.getbufoneline

This commit is contained in:
JuanZoran
2023-03-16 21:15:00 +08:00
parent 4a0f9b5c85
commit b9abc99086
9 changed files with 118 additions and 32 deletions

View File

@ -15,14 +15,12 @@ function M.tag(hover, result)
local size = #tag
for i = 1, size, 3 do
buffer:setline(
it(
interval .. tag[i] ..
(tag[i + 1] and interval .. tag[i + 1] ..
(tag[i + 2] and interval .. tag[i + 2] or '') or ''),
'TransTag'
)
)
buffer:setline(it(
interval .. tag[i] ..
(tag[i + 1] and interval .. tag[i + 1] ..
(tag[i + 2] and interval .. tag[i + 2] or '') or ''),
'TransTag'
))
end
buffer:setline('')
@ -63,6 +61,11 @@ end
function M.title(hover, result)
local title = result.title
if not title then return end
if type(title) == 'string' then
hover.buffer:setline(it(title, 'TransWord'))
return
end
local icon = hover.opts.icon