Skip to content

Commit

Permalink
Render tabs with 8 spaces (previously 4)
Browse files Browse the repository at this point in the history
Most web UIs seem to do this (e.g. on GitHub), and C code from the
Linux kernel assumes 8 spaces in a tab when aligning things.
  • Loading branch information
Wilfred committed Apr 18, 2022
1 parent 4163657 commit 34fd5ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Improved performance in large files when changes are clustered together.

Improved syntax highlighting for keywords.

Tabs are now rendered with eight spaces.

### Command Line Interface

Difftastic now validates environment variables the same way as
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ fn diff_file_content(
// TODO: don't replace tab characters inside string literals.
let mut lhs_src = String::from_utf8_lossy(lhs_bytes)
.to_string()
.replace('\t', " ");
.replace('\t', " ");
let mut rhs_src = String::from_utf8_lossy(rhs_bytes)
.to_string()
.replace('\t', " ");
.replace('\t', " ");

// Ignore the trailing newline, if present.
// TODO: highlight if this has changes (#144).
Expand Down

0 comments on commit 34fd5ba

Please sign in to comment.