Skip to content

Commit 8fe9a72

Browse files
committed
fixing issues #66 #68 and #69 - rendering of tabs
1 parent 55d3a78 commit 8fe9a72

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ui/tui.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,14 @@ fn render_slice(
682682
};
683683

684684
if *cols + w <= max_cols {
685-
buf.push(ch);
685+
if ch == '\t' {
686+
// Tab is just a control character that moves the cursor rather than
687+
// replacing the previous buffer content so we need to explicitly
688+
// insert spaces instead.
689+
buf.extend(std::iter::repeat_n(' ', tabstop));
690+
} else {
691+
buf.push(ch);
692+
}
686693
*cols += w;
687694
} else {
688695
break;

0 commit comments

Comments
 (0)