Skip to content

Apply selection_foreground to the Visual highlight - #7

Open
ishansing wants to merge 1 commit into
omacom:v3from
ishansing:fix/visual-selection-foreground
Open

Apply selection_foreground to the Visual highlight#7
ishansing wants to merge 1 commit into
omacom:v3from
ishansing:fix/visual-selection-foreground

Conversation

@ishansing

Copy link
Copy Markdown

Problem

Visual and VisualNOS only set a background (bg = c.bg_visual), so selected text falls back to the regular foreground. On themes whose selection color sits close to the foreground, selected text becomes unreadable (e.g. light selection + light text).

selection_foreground is already part of the palette (declared in colors/init.lua, documented in the README, and passed through by Omarchy themes via colors.toml) but is never applied.

Fix

Set the selection fg from selection_foreground, keeping the existing bg:

Visual    = { fg = c.selection_foreground, bg = c.bg_visual },
VisualNOS = { fg = c.selection_foreground, bg = c.bg_visual },

Verification

With a theme defining selection_foreground = \#05060d\ and selection = \#b6cfdf\:

Visual fg=0x05060d bg=0xb6cfdf

The default #dfe6eb remains unchanged for users who never set the value, so existing themes are unaffected.

Visual and VisualNOS only set a background, so selected text falls back to
the regular foreground. On themes whose selection color is close to the
foreground, selected text becomes unreadable. Honor selection_foreground
as the fg so themes can control selection text contrast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant