Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct completion menu current item color styling #2980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivnvxd
Copy link

@ivnvxd ivnvxd commented Jan 23, 2025

This PR fixes an issue where the completion-menu-current-color and completion-menu-current-bg-color properties were incorrectly applied.

Previously:

  • completion-menu-current-color was setting the background color
  • completion-menu-current-bg-color was setting the text color

This was backwards from the expected behavior and from how prompt_toolkit's default styling works (where fg sets text color and bg sets background color).

The fix

  • Swapped the color assignments so:
    • completion-menu-current-color now properly sets the text color
    • completion-menu-current-bg-color now properly sets the background color

This matches prompt_toolkit's default styling pattern seen in defaults.py:

 ("completion-menu.completion.current", "fg:#888888 bg:#ffffff reverse")

Now when using:

  • completion-menu-current-color: blue
  • completion-menu-current-bg-color: red

The selected completion item will show:

  • Blue text on a red background (instead of the previous red text on blue background)

This provides more intuitive color configuration and matches the expected styling behavior.

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