Fix tab replacement in single-column display

Fixes #617
pull/619/head
Wilfred Hughes 2024-01-07 19:35:33 +07:00
parent 8ad07174c9
commit 2d61aefb84
2 changed files with 6 additions and 3 deletions

@ -8,6 +8,9 @@ Added support for Objective-C.
The default display width for tabs has changed to 4. The default display width for tabs has changed to 4.
Fixed an issue where difftastic would sometimes output literal tabs
rather than respecting the display width for tabs.
## 0.54 (released 7th January 2024) ## 0.54 (released 7th January 2024)
### Parsing ### Parsing

@ -14,8 +14,8 @@ use crate::{
display::context::all_matched_lines_filled, display::context::all_matched_lines_filled,
display::hunks::{matched_lines_indexes_for_hunk, Hunk}, display::hunks::{matched_lines_indexes_for_hunk, Hunk},
display::style::{ display::style::{
self, apply_colors, apply_line_number_color, color_positions, novel_style, split_and_apply, self, apply_colors, apply_line_number_color, color_positions, novel_style, replace_tabs,
BackgroundColor, split_and_apply, BackgroundColor,
}, },
hash::DftHashMap, hash::DftHashMap,
lines::format_line_num, lines::format_line_num,
@ -102,7 +102,7 @@ fn display_single_column(
.style(style) .style(style)
.to_string(), .to_string(),
); );
formatted_line.push_str(line); formatted_line.push_str(&replace_tabs(line, display_options.tab_width));
formatted_lines.push(formatted_line); formatted_lines.push(formatted_line);
} }