diff --git a/src/preprocessor.rs b/src/preprocessor.rs index 64600419..2380e7f9 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -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 { diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 948ec457..b75cbafe 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -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├───┤?␊