Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lua/snacks/scroll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ function M.enable()
end),
})

-- clean up state when a window is closed
vim.api.nvim_create_autocmd("WinClosed", {
group = group,
callback = function(ev)
local win = tonumber(ev.match)
if win then
State.reset(win)
end
end,
})

-- clear scroll state when leaving the cmdline after a search with incsearch
vim.api.nvim_create_autocmd({ "CmdlineLeave" }, {
group = group,
Expand Down
Loading