Skip to content

Commit

Permalink
fix: use modeline=false for popupmenu scroll events. Fixes #572
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 19, 2023
1 parent e50fc6d commit 1f087c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/noice/ui/popupmenu/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ end
function M.on_select(state)
if M.menu and state.selected ~= -1 then
vim.api.nvim_win_set_cursor(M.menu.winid, { state.selected + 1, 0 })
vim.cmd([[do WinScrolled]])
vim.api.nvim_exec_autocmds("WinScrolled", { modeline = false })
end
end

Expand Down
2 changes: 1 addition & 1 deletion lua/noice/util/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function M.scroll(win, delta)
vim.defer_fn(function()
vim.api.nvim_buf_call(buf, function()
vim.api.nvim_command("noautocmd silent! normal! " .. top .. "zt")
vim.cmd([[do WinScrolled]])
vim.api.nvim_exec_autocmds("WinScrolled", { modeline = false })
end)
end, 0)
end
Expand Down

0 comments on commit 1f087c2

Please sign in to comment.