Skip to content

bug: cmdline completion popup scrollbar thumb doesn't scroll #1119

@cameronr

Description

@cameronr

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.11.2

Operating system/version

MacOS 15.5

Describe the bug

The cmdline autocomplete window scrollbar thumb never moves, regardless of how far you scroll down:

Image

I spent some time tracing it through and the scrollbar element isn't getting the WinScrolled event because the autocmd is set up with a pattern but the event is dispatched without one.

autocmd setup:

vim.api.nvim_create_autocmd("WinScrolled", {
group = self.augroup,
pattern = tostring(self.winnr),
callback = function()
self:update()
end,
})

event dispatch:

function M.on_select(state, redraw)
if M.menu then
if state.selected == -1 then
vim.wo[M.menu.winid].cursorline = false
else
vim.wo[M.menu.winid].cursorline = true
vim.api.nvim_win_set_cursor(M.menu.winid, { state.selected + 1, 0 })
vim.api.nvim_exec_autocmds("WinScrolled", { modeline = false })
if redraw ~= false and Util.is_blocking() then
Util.redraw()
end
end
end
end

Adding the win id to nvim_exec_autocmds fixes it:

vim.api.nvim_exec_autocmds("WinScrolled", { pattern = tostring(M.menu.winid), modeline = false })
Image

I'll submit a PR

Steps To Reproduce

  1. start typing a command
  2. press tab multiple times
  3. observe that the scroll thumb does not move

Expected Behavior

The scroll thumb should indicate scroll position

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/noice.nvim", opts = {} },
    -- add any other plugins here
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a whilewontfixThis issue will not be fixed or implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions