Skip to content

Commit

Permalink
fix(menu): set init cursor pos only on the first time opening a menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Jun 5, 2023
1 parent 060a09b commit 1e56ced
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/dropbar/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,11 @@ function dropbar_menu_t:open(win_configs)
vim.wo[self.win].sidescrolloff = 0
_G.dropbar.menus[self.win] = self
-- Initialize cursor position
if self._win_configs.focusable ~= false and self.cursor then
if
self._win_configs.focusable ~= false
and not self.prev_cursor
and self.cursor
then
vim.api.nvim_win_set_cursor(self.win, self.cursor)
end
end
Expand Down

0 comments on commit 1e56ced

Please sign in to comment.