mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(scroll): update state on TextChanged and InsertLeave
This commit is contained in:
parent
22db0cb0bb
commit
d6d84406f9
1 changed files with 10 additions and 0 deletions
|
@ -121,6 +121,16 @@ function M.enable()
|
|||
end),
|
||||
})
|
||||
|
||||
-- update state when leaving insert mode or changing text in normal mode
|
||||
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
|
||||
group = group,
|
||||
callback = vim.schedule_wrap(function(ev)
|
||||
for _, win in ipairs(vim.fn.win_findbuf(ev.buf)) do
|
||||
get_state(win)
|
||||
end
|
||||
end),
|
||||
})
|
||||
|
||||
-- update current state on cursor move
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
group = group,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue