Skip to content

Commit

Permalink
fix(popup): always use current window for relative=cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 authored Mar 12, 2024
1 parent fc59553 commit 3dc46d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/nui/layout/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ function mod.update_layout_config(component_internal, config)
if options.relative then
internal.layout.relative = options.relative

local fallback_winid = internal.position and internal.position.win or vim.api.nvim_get_current_win()
local fallback_winid = internal.position and internal.position.win
or internal.layout.relative.type == "cursor" and 0
or vim.api.nvim_get_current_win()
internal.position =
vim.tbl_extend("force", internal.position or {}, mod.parse_relative(internal.layout.relative, fallback_winid))

Expand Down

0 comments on commit 3dc46d7

Please sign in to comment.