Skip to content

Commit

Permalink
fix(ui/SectionLineView): replace tab characters in lines
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed May 25, 2024
1 parent 290623e commit db2e9bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3049,6 +3049,10 @@ impl Component for SectionLineView<'_> {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
fn replacement_characters(character: char) -> Option<&'static str> {
match character {
// Characters end up writing over each-other and end up
// displaying incorrectly if ignored. Replacing tabs
// with a known length string fixes the issue for now.
'\t' => Some("→ "),
'\n' => Some("⏎"),
_ => None,
}
Expand Down

0 comments on commit db2e9bd

Please sign in to comment.