Skip to content

Commit

Permalink
fix(menu): should set cursor to previous position explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Jun 6, 2023
1 parent 90fbd49 commit 7d20061
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lua/dropbar/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,12 @@ function dropbar_menu_t:open()
vim.wo[self.win].sidescrolloff = 0
_G.dropbar.menus[self.win] = self
-- Initialize cursor position
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)
if self._win_configs.focusable ~= false then
if self.prev_cursor then
vim.api.nvim_win_set_cursor(self.win, self.prev_cursor)
elseif self.cursor then
vim.api.nvim_win_set_cursor(self.win, self.cursor)
end
end
end

Expand Down

0 comments on commit 7d20061

Please sign in to comment.