Skip to content

fix: swap foreground/background colors in completion menu current item#4931

Open
karesansui-u wants to merge 1 commit intoAider-AI:mainfrom
karesansui-u:fix/completion-menu-color-swap
Open

fix: swap foreground/background colors in completion menu current item#4931
karesansui-u wants to merge 1 commit intoAider-AI:mainfrom
karesansui-u:fix/completion-menu-color-swap

Conversation

@karesansui-u
Copy link
Copy Markdown

Bug description

The completion-menu.completion.current style in io.py has its foreground and background colors reversed compared to the non-current completion-menu style.

The non-current (correct) pattern:

# completion-menu — correct
f"bg:{self.completion_menu_bg_color}"     # bg: prefix → background
self.completion_menu_color                 # no prefix → foreground

The current-item (swapped) pattern:

# completion-menu.completion.current — swapped
self.completion_menu_current_bg_color      # no bg: prefix → applied as foreground
f"bg:{self.completion_menu_current_color}" # bg: prefix → applied as background

Steps to reproduce

aider --completion-menu-current-color '#FFFFFF' --completion-menu-current-bg-color '#0000FF'
  1. Type to trigger the completion menu (Tab)
  2. Expected: Blue background with white text on the selected item
  3. Actual: White background with blue text (inverted)

Fix

Apply the bg: prefix to completion_menu_current_bg_color and remove it from completion_menu_current_color, matching the pattern used for the non-current menu style.

Affected files

  • aider/io.py (L424-427) — 2 line change

The completion-menu.completion.current style has its fg and bg colors
reversed compared to the non-current completion-menu style. The bg:
prefix is applied to the foreground color and omitted from the
background color, causing the selected item's colors to be inverted.
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