Skip to content

Commit

Permalink
fix(strings): replace unicode whitespace for correct rendering (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun authored Sep 17, 2024
1 parent 54940f9 commit 3179751
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,14 +819,22 @@ pub fn render_strings(state: &mut State, frame: &mut Frame, rect: Rect) {
spans.extend(highlight_search_result(
value
.chars()
.map(|c| if c.is_whitespace() { ' ' } else { c })
.take(max_row_width.saturating_sub(index.width()))
.collect::<String>()
.into(),
&state.input,
));
spans.push("…".fg(Color::Rgb(100, 100, 100)));
} else {
spans.extend(highlight_search_result(value.into(), &state.input))
spans.extend(highlight_search_result(
value
.chars()
.map(|c| if c.is_whitespace() { ' ' } else { c })
.collect::<String>()
.into(),
&state.input,
))
}
Line::from(spans)
})])
Expand Down

0 comments on commit 3179751

Please sign in to comment.