From d6946d40bd8f92c937e4cfe89dc41fea1a05c8ff Mon Sep 17 00:00:00 2001 From: Mohammad AlSaleh Date: Sun, 21 Jan 2024 20:46:56 +0300 Subject: [PATCH] Fix tab skip rendering Replace '\t' with a space in text buffers, as tab skip/stop is handled by `alacritty_terminal`. Also, sending a tab to the shaper causes issues, as fonts either have no tab codepoint, or worse, some do, with the glyph produced being anyone's guess. Some may render a tab to some random character like '0'. Fixes #73. Signed-off-by: Mohammad AlSaleh --- src/terminal.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/terminal.rs b/src/terminal.rs index 5785767..63a9e8c 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -633,7 +633,8 @@ impl Terminal { buffer.set_redraw(true); } - if buffer.lines[line_i].set_text(text.clone(), attrs_list.clone()) { + // Tab skip/stop is handled by alacritty_terminal + if buffer.lines[line_i].set_text(text.replace('\t', " "), attrs_list.clone()) { buffer.set_redraw(true); } line_i += 1;