mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(picker): no need to track jumping
This commit is contained in:
parent
08e6c12358
commit
b37ea748b6
3 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue