style: code format

This commit is contained in:
JuanZoran
2023-03-18 13:53:09 +08:00
parent a6a5a33bff
commit 46c69fb758
8 changed files with 190 additions and 272 deletions

View File

@ -3,35 +3,33 @@ local api = vim.api
---@type table<string, fun(hover: TransHover)>
local strategy = {
pageup = function(hover)
hover.buffer:normal('gg')
hover.buffer:normal("gg")
end,
pagedown = function(hover)
hover.buffer:normal('G')
hover.buffer:normal("G")
end,
pin = function(hover)
if hover.pin then return end
if hover.pin then
return
end
hover.pin = true
local window = hover.window
local width, height = window:width(), window:height()
local col = vim.o.columns - width - 3
window:try_close()
window = hover:init_window({
width = width,
height = height,
relative = 'editor',
col = col,
})
window = hover:init_window {
col = col,
width = width,
height = height,
relative = "editor",
}
window:set('wrap', true)
window:set("wrap", true)
end,
close = function(hover)
hover:destroy()
end,
toggle_entry = function(hover)
if api.nvim_get_current_win() ~= hover.window.winid then
api.nvim_set_current_win(hover.window.winid)
@ -47,7 +45,6 @@ local strategy = {
end,
}
---@class TransHover
---@field execute fun(hover: TransHover, action: string)
return function(hover, action)