diff options
author | Wilfred Hughes <me@wilfred.me.uk> | 2022-01-24 20:33:31 -0800 |
---|---|---|
committer | Wilfred Hughes <me@wilfred.me.uk> | 2022-01-24 20:34:34 -0800 |
commit | 440c94ce3c179c7a4aa76edae32a1575891dbb9c (patch) | |
tree | 0bfd73ed55d8a95b05eda18d0110d71dca6ad545 | |
parent | 1a26441c5289a39cee67f154faaeca2b2d01e48c (diff) |
Don't treat identical text files as binary
Looks like a copy-paste mistake.
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a36c3a34c..e62a374704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ Improved performance when all file changes are close together. Added syntax highlighting for unchanged comments, strings and types. +Fixed a bug (introduced in 0.15) where identical text files were +reported as binary files. + ## 0.16 (released 22 January 2022) ### Parsing diff --git a/src/main.rs b/src/main.rs index 903764e0cd..e46ee7e47a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,7 +292,7 @@ fn diff_file_content(display_path: &str, lhs_bytes: &[u8], rhs_bytes: &[u8]) -> return DiffResult { path: display_path.into(), language: ts_lang.map(|l| l.name.into()), - binary: true, + binary: false, lhs_src: "".into(), rhs_src: "".into(), lhs_positions: vec![], @@ -431,5 +431,6 @@ mod tests { assert_eq!(res.lhs_positions, vec![]); assert_eq!(res.rhs_positions, vec![]); + assert!(!res.binary); } } |