mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker.preview): don't record previeww searches in history and prevent scrolling from the top. Closes #2305
This commit is contained in:
parent
2c56e10b1d
commit
080320bb82
1 changed files with 3 additions and 3 deletions
|
|
@ -353,9 +353,9 @@ function M:loc()
|
||||||
end
|
end
|
||||||
elseif self.item.search then
|
elseif self.item.search then
|
||||||
vim.api.nvim_win_call(self.win.win, function()
|
vim.api.nvim_win_call(self.win.win, function()
|
||||||
vim.cmd("keepjumps norm! gg")
|
if pcall(vim.cmd, ":0;" .. self.item.search) then
|
||||||
if pcall(vim.cmd, self.item.search) then
|
vim.fn.histdel("search", -1) -- remove from search history
|
||||||
vim.cmd("norm! zz")
|
vim.cmd("norm! zzze")
|
||||||
self:wo({ cursorline = true })
|
self:wo({ cursorline = true })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue