Skip to content

Commit

Permalink
refactor: move win relative check to eval_win_configs
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Sep 26, 2023
1 parent 336f525 commit c2476b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/dropbar/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ function dropbar_menu_t:eval_win_configs()
self._win_configs[k] = config
end
end

if self._win_configs.relative ~= 'win' then
self._win_configs.win = nil
end
end

---Get the component at the given position in the dropbar menu
Expand Down Expand Up @@ -490,10 +494,6 @@ function dropbar_menu_t:open_win()
end
self.is_opened = true

if self._win_configs.relative ~= 'win' then
self._win_configs.win = nil
end

self.win = vim.api.nvim_open_win(self.buf, true, self._win_configs)
vim.wo[self.win].scrolloff = 0
vim.wo[self.win].sidescrolloff = 0
Expand Down

0 comments on commit c2476b4

Please sign in to comment.