@@ -36,13 +36,7 @@ pub fn expand_tabs(line: &str, width: usize, cursor: &mut usize) -> String {
3636pub fn replace_nonprintable(input: &mut Vec<u8>, output: &mut Vec<u8>, tab_width: usize) {
3737 output.clear();
3838
39− let tab_width = if tab_width == 0 {
40− 4
41− } else if tab_width == 1 {
42− 2
43− } else {
44− tab_width
45− };
39+ let tab_width = if tab_width == 0 { 4 } else { tab_width };
4640
4741 for chr in input {
4842 match *chr {
@@ -50,9 +44,13 @@ pub fn replace_nonprintable(input: &mut Vec<u8>, output: &mut Vec<u8>, tab_width
5044 b' ' => output.extend_from_slice("•".as_bytes()),
5145 // tab
5246 b'\t' => {
53− output.extend_from_slice("├".as_bytes());
54− output.extend_from_slice("─".repeat(tab_width - 2).as_bytes());
55− output.extend_from_slice("┤".as_bytes());
47+ if tab_width == 1 {
48+ output.extend_from_slice("↹".as_bytes());
49+ } else {
50+ output.extend_from_slice("├".as_bytes());
51+ output.extend_from_slice("─".repeat(tab_width - 2).as_bytes());
52+ output.extend_from_slice("┤".as_bytes());
53+ }
5654 }
5755 // new line
5856 b'\n' => output.extend_from_slice("".as_bytes()),