fix(picker): no need to track jumping

This commit is contained in:
Folke Lemaitre 2025-01-31 06:11:03 +01:00
parent 08e6c12358
commit b37ea748b6
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 3 additions and 6 deletions

View file

@ -20,14 +20,14 @@ function M.jump(picker, _, action)
return
end
local items = picker:selected({ fallback = true })
if picker.opts.jump.close then
picker:close()
else
picker.jumping = true
if vim.api.nvim_win_is_valid(picker.main) then
vim.api.nvim_set_current_win(picker.main)
end
picker.jumping = false
end
if action.cmd then
@ -60,8 +60,6 @@ function M.jump(picker, _, action)
end
end
local items = picker:selected({ fallback = true })
for _, item in ipairs(items) do
-- load the buffer
local buf = item.buf ---@type number

View file

@ -27,7 +27,6 @@ local _id = 0
---@field closed? boolean
---@field history snacks.picker.History
---@field visual? snacks.picker.Visual
---@field jumping? boolean
local M = {}
M.__index = M

View file

@ -53,7 +53,7 @@ function State:follow()
return
end
local picker = self.picker()
if not picker or picker:is_focused() or picker.closed or picker.jumping then
if not picker or picker:is_focused() or picker.closed then
return
end
local buf = vim.api.nvim_get_current_buf()