[vim/vim] Selected match in HTML tag is indistinguishable from non-selected matches in dark terminals (Issue #21406)

10 views
Skip to first unread message

acorn931

unread,
Sep 29, 2026, 10:37:32 PM (2 days ago) Sep 29
to vim/vim, Subscribed
acorn931 created an issue (vim/vim#21406)

Steps to reproduce

For this reproduction, I'm using the MDN's basic HTML template.

  1. Ensure the terminal emulator is in dark style/mode
    For GNOME Console and Ptyxis, this can be done from the main menu (F10). Ptyxis users should also set the GNOME colour palette in preferences (Ctrl+,), under the 'Appearance' tab.
    For Konsole, ensure your profile's colour scheme is 'Breeze', which is the default for the 'Built-in' profile.
  2. Edit the HTML file with Vim using vim --clean index.html
  3. Enable hlsearch with :set hlsearch
  4. Perform a search for meta with /meta without pressing <Enter>
  5. Cycle between the results with CTRL-G/CTRL-T

All matches are visually indistinguishable (black text, yellow highlight), making it impossible to tell which is selected without further configuration.

This is not an issue in light style/mode.

Expected behaviour

When the terminal emulators (Ptyxis, GNOME Console, and Konsole) are in light style/mode, Vim colours the meta text a darker shade of yellow. This distinction is important since the selected match is highlighted by reversing the text and background colour, while the non-selected matches simply use a light shade of yellow.

This means the match highlighting behaviour differs between light/dark terminal emulators:

  • In light style/mode: the selected match is a dark shade of yellow, the non-selected matches are a light shade of yellow.
Image: Image (view on web)
  • In dark style/mode: all matches (selected, non-selected) share the same light shade of yellow. They're visually indistinguishable.
Image: Image (view on web)

I'd expect the difference to be equally obvious when the terminal emulator is in dark style/mode.

I should note that setting termguicolors does make the selected match distinguishable in dark style/mode, as its background now adopts a slightly darker shade of yellow then the non-selected matches. Though it's certainly not a fix, since it remains difficult to discern the difference.

Version of Vim

9.2.1119

Environment

Operating system: Fedora Linux 43 (Workstation Edition)
Terminal: Ptyxis 49.3 (Fedora Workstation default, primary), GNOME Console 49.2, Konsole 26.08.0
Value of $TERM: xterm-256color
Shell: fish, version 4.2.0

Logs and stack traces

—
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/21406@github.com>

Maxim Kim

unread,
Sep 29, 2026, 11:03:37 PM (2 days ago) Sep 29
to vim/vim, Subscribed
habamax left a comment (vim/vim#21406)
  1. For set bg=dark incremental search IncSearch is the reverse of foreground and background: hi IncSearch cterm=reverse.
  2. HTML tags are highlighted as Statement which is ctermfg=11, bright yellow defined by term palette
  3. So the IncSearch over meta would be bright yellow background (=11) and black foreground.
  4. Search is defined as ctermbg=11 -- same bright yellow as Statements

Thus no difference between Search and IncSearch when IncSearch is over something that is highlighted as Statement.

For set bg=light the Statement has the color outside 16-palette, =130 that is why it is different.

—
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/21406/5903219190@github.com>

Reply all
Reply to author
Forward
0 new messages