]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1621: flicker in popup menu during cmdline autocompletion v9.1.1621
authorGirish Palya <girishji@gmail.com>
Fri, 8 Aug 2025 06:26:03 +0000 (08:26 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 10 Aug 2025 07:55:18 +0000 (09:55 +0200)
commitda9c9668931e5c8ee4dc0e430898ad2d80f56862
tree3e19bf951b3f1bdaeaa381ed1d174ff535853a6d
parent4fca92faa2079d4bb1ece3bd31a4278881a7dacb
patch 9.1.1621: flicker in popup menu during cmdline autocompletion

Problem:  When the popup menu (PUM) occupies more than half the screen
          height, it flickers whenever a character is typed or erased.
          This happens because the PUM is cleared and the screen is
          redrawn before a new PUM is rendered. The extra redraw between
          menu updates causes visible flicker.
Solution: A complete, non-hacky fix would require removing the
          CmdlineChanged event from the loop and letting autocompletion
          manage the process end-to-end. This is because screen redraws
          after any cmdline change are necessary for other features to
          work.
          This change modifies wildtrigger() so that the next typed
          character defers the screen update instead of redrawing
          immediately. This removes the intermediate redraw, eliminating
          flicker and making cmdline autocompletion feel smooth
          (Girish Palya).

Trade-offs:
This behavior change in wildtrigger() is tailored specifically for
:h cmdline-autocompletion. wildtrigger() now has no general-purpose use
outside this scenario.

closes: #17932

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/ex_getln.c
src/proto/cmdexpand.pro
src/testdir/dumps/Test_wildtrigger_update_screen_1.dump [new file with mode: 0644]
src/testdir/dumps/Test_wildtrigger_update_screen_2.dump [new file with mode: 0644]
src/testdir/dumps/Test_wildtrigger_update_screen_3.dump [new file with mode: 0644]
src/testdir/test_cmdline.vim
src/version.c