Skip to content

Highlight search results #2

@orhun

Description

@orhun

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions