Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Robitx committed Feb 27, 2024
1 parent fed4875 commit a0ab753
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1545,22 +1545,18 @@ M.open_buf = function(file_name, target, kind, toggle)
if target == M.BufTarget.popup then
local old_buf = M._H.get_buffer(file_name)

buf, win, close, _ = M._H.create_popup(
old_buf,
M._Name .. " Popup",
function(w, h)
local top = M.config.style_popup_margin_top or 2
local bottom = M.config.style_popup_margin_bottom or 8
local left = M.config.style_popup_margin_left or 1
local right = M.config.style_popup_margin_right or 1
local max_width = M.config.style_popup_max_width or 160
local ww = math.min(w - (left + right), max_width)
local wh = h - (top + bottom)
return ww, wh, top, (w - ww) / 2
end,
{ on_leave = false, escape = false, persist = true },
{ border = M.config.style_popup_border or "single" }
)
buf, win, close, _ = M._H.create_popup(old_buf, M._Name .. " Popup", function(w, h)
local top = M.config.style_popup_margin_top or 2
local bottom = M.config.style_popup_margin_bottom or 8
local left = M.config.style_popup_margin_left or 1
local right = M.config.style_popup_margin_right or 1
local max_width = M.config.style_popup_max_width or 160
local ww = math.min(w - (left + right), max_width)
local wh = h - (top + bottom)
return ww, wh, top, (w - ww) / 2
end, { on_leave = false, escape = false, persist = true }, {
border = M.config.style_popup_border or "single",
})

if not toggle then
M._toggle_add(M._toggle_kind.popup, { win = win, buf = buf, close = close })
Expand Down

0 comments on commit a0ab753

Please sign in to comment.