vim-patch:9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect' (#34836)

Problem:  When 'wildmode' is set to include "noselect", the popup menu (pum)
          incorrectly retained its scroll position when reopened. This
          meant that after scrolling down through the menu with `<C-n>`,
          reopening the menu (e.g., by retyping the command and
          triggering completion again) would show the menu starting from
          the previously scrolled position, rather than from the top.
          This could confuse users, as the first visible item would not
          be the first actual match in the list.

Solution: Ensure that the popup menu resets its scroll position to the
          top when reopened (Girish Palya).

closes: vim/vim#17673

0cd7f3536b

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-07-08 06:37:30 +08:00
committed by GitHub
parent 2031287e93
commit c3c8d25293
3 changed files with 75 additions and 0 deletions

View File

@ -390,6 +390,7 @@ static int cmdline_pum_create(CmdlineInfo *ccline, expand_T *xp, char **matches,
// no default selection
compl_selected = -1;
pum_clear();
cmdline_pum_display(true);
return EXPAND_OK;