From a7984aef91e1f23db03bb07c885c16fa5fe03f5d Mon Sep 17 00:00:00 2001 From: Carter Canedy Date: Mon, 23 Sep 2024 11:58:45 -0700 Subject: [PATCH] expand tabs during command processing --- tui/src/floating_text.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tui/src/floating_text.rs b/tui/src/floating_text.rs index 2cd638240..1ac4ba82d 100644 --- a/tui/src/floating_text.rs +++ b/tui/src/floating_text.rs @@ -134,7 +134,7 @@ fn get_lines_owned(s: &str) -> Vec { impl FloatingText { pub fn new(text: String, mode: FloatingTextMode) -> Self { - let src = get_lines(&text) + let src = get_lines(&text.replace("\t", " ")) .into_iter() .map(|s| s.to_string()) .collect::>(); @@ -168,7 +168,7 @@ impl FloatingText { Command::None => (0usize, None), }; - let src = get_lines_owned(&get_highlighted_string(&src?)?); + let src = get_lines_owned(&get_highlighted_string(&src?.replace("\t", " "))?); Some(Self { src,