patch 9.1.1521: completion: pum does not reset scroll pos on reopen with 'noselect'

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: #17673

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-07-07 19:47:53 +02:00
committed by Christian Brabandt
parent af22007784
commit 0cd7f3536b
5 changed files with 54 additions and 0 deletions

View File

@ -411,6 +411,7 @@ cmdline_pum_create(
// no default selection
compl_selected = -1;
pum_clear();
cmdline_pum_display();
return EXPAND_OK;