fix(picker.preview): don't record previeww searches in history and prevent scrolling from the top. Closes #2305

This commit is contained in:
Folke Lemaitre 2025-10-21 23:29:58 +02:00
parent 2c56e10b1d
commit 080320bb82
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -353,9 +353,9 @@ function M:loc()
end
elseif self.item.search then
vim.api.nvim_win_call(self.win.win, function()
vim.cmd("keepjumps norm! gg")
if pcall(vim.cmd, self.item.search) then
vim.cmd("norm! zz")
if pcall(vim.cmd, ":0;" .. self.item.search) then
vim.fn.histdel("search", -1) -- remove from search history
vim.cmd("norm! zzze")
self:wo({ cursorline = true })
end
end)