Skip to content

Commit

Permalink
feat: added support for negative positions. Fixes #179
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 7, 2022
1 parent dbadd10 commit 8d7a63c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/noice/util/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ function M.normalize_popup_options(opts)
-- relative, position, size
_.normalize_layout_options(opts)

if opts.position and opts.position.row and type(opts.position.row) == "number" and opts.position.row < 0 then
opts.position.row = vim.go.lines + opts.position.row
end
if opts.position and opts.position.col and type(opts.position.col) == "number" and opts.position.col < 0 then
opts.position.col = vim.go.columns + opts.position.col
end

-- border
local border = opts.border
if type(border) == "string" then
Expand Down

0 comments on commit 8d7a63c

Please sign in to comment.