correctly handle multiple tabs in one line

This commit is contained in:
Patrick Hilhorst authored and David Peter committed 2022-03-06 20:03:00 +01:00
1 parent 67124f8513
commit e7df748b6d
2 files changed
+3 -2

No files matched your search

+1
View File
@@ -66,6 +66,7 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String {
// tab
'\t' => {
let tab_stop = tab_width - ((line_idx - 1) % tab_width);
line_idx = 0;
if tab_stop == 1 {
output.push('↹');
} else {
+2 -2
View File
@@ -1227,7 +1227,7 @@ fn show_all_tabstops() {
.assert()
.success()
.stdout(
"├──┤1├┤2├──┤3├┤4␊
"├──┤1├─┤2├─┤3├─┤4␊
1├─┤?␊
22├┤?␊
333↹?␊
@@ -1250,7 +1250,7 @@ fn show_all_tabstops_long() {
.assert()
.success()
.stdout(
"├──────┤1├────┤2├──┤3├┤4␊
"├──────┤1├─────┤2├─────┤3├─────┤4␊
1├─────┤?␊
22├────┤?␊
333├───┤?␊