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

Add SearchHighlightStyle method to SelectionPromptExtensions #1656

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

Conversation

fihorvat
Copy link

@fihorvat fihorvat commented Sep 25, 2024

fixes #

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

I added the extension method for defining SearchHighlightStyle same as we have for HighlightStyle.

This allows us to specify SearchHighlightStyle using a fluent style like this:

AnsiConsole.Prompt(
  new SelectionPrompt<CustomSelectionItem>()
    .Title("Select one")
    .EnableSearch()
    .UseConverter(o => o.Name)
    .HighlightStyle(Color.Green)
    .SearchHighlightStyle(Color.DarkGreen) //<--
    .AddChoices(choices));

Please upvote 👍 this pull request if you are interested in it.

@fihorvat
Copy link
Author

@microsoft-github-policy-service agree

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