[vim/vim] helptoc navigation jumps incorrectly and flickers when hlsearch is active and using J/K (Issue #21051)

3 views
Skip to first unread message

VimWei

unread,
Aug 14, 2026, 10:05:02 AM (2 days ago) Aug 14
to vim/vim, Subscribed
VimWei created an issue (vim/vim#21051)

Issue Description:
When active search highlighting (hlsearch) is present in the buffer, navigating the helptoc popup menu via J / K causes screen flickering and incorrect cursor movement when changing heading depth levels.


Steps to Reproduce:

  1. Create a Markdown file (e.g., test.md) with hierarchical headers:
# level 1 a
## level 2 b
### level 3 c
### level 3 d
### level 3 e
### level 3 f
  1. Open the file in GVIM and trigger search highlighting (e.g., /level and press Enter). Ensure hlsearch is active.
  2. Open the table of contents popup via :HelpToc.
  3. Press uppercase J or K to navigate through the popup entries.

Observed Behavior:

  1. Window Flickering: Every keypress of J or K causes the helptoc popup window to flicker/redraw.
  2. First Jump Lag on Depth Change: When moving between different heading levels (e.g., from ## level 2 b down to ### level 3 c):
  • 1st press of J: The cursor remains stuck at ## level 2 b.
  • 2nd press of J: The cursor finally jumps to ### level 3 c.
  1. Unexpected Cursor Retreat: Continuing to press J to move from ### level 3 c down to ### level 3 d causes the window to flicker and the cursor to incorrectly jump back up to ## level 2 b.

Expected Behavior:
helptoc navigation using J / K should smoothly move between heading items regardless of active search highlighting (hlsearch), without screen flickering or incorrect level jumps.


Environment:

  • OS: Windows 10
  • Vim Version: gVim 9.2.0907 x64 (signed)
  • Terminal/GUI: gVim (GUI)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21051@github.com>

Reply all
Reply to author
Forward
0 new messages