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

Highlight search results #2

Open
orhun opened this issue May 18, 2024 · 0 comments
Open

Highlight search results #2

orhun opened this issue May 18, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@orhun
Copy link
Owner

orhun commented May 18, 2024

Is your feature request related to a problem? Please describe.

While searching, it would be visually nice to see the found results being highlighted in the list.

For example:

image

Describe the solution you'd like

This needs some reading on displaying text docs but I'm thinking we can simply change the colors of Spans somehow.

Describe alternatives you've considered

None.

Additional context

See https://ratatui.rs/how-to/render/display-text and

flawz/src/main.rs

Lines 73 to 85 in 32fb9ac

let items = items
.into_iter()
.filter(|cve| {
query.is_empty()
|| cve.id.to_lowercase().contains(&query)
|| cve
.description
.clone()
.unwrap_or_default()
.to_lowercase()
.contains(&query)
})
.collect();

@orhun orhun added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 18, 2024
@orhun orhun assigned orhun and unassigned orhun May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant