Ensure that textual fallback diffing has a parse language of None

Previously we still passed the parse language after exceeding the
graph limit, leading to incorrect underline highlighting.
pull/454/head
Wilfred Hughes 2023-01-06 19:07:05 +07:00
parent 8a799af0ff
commit 610a6e441d
2 changed files with 5 additions and 1 deletions

@ -20,6 +20,9 @@ constituents.
`--display=inline` now respects `--tab-width`.
Fixed an issue with unwanted underlines with textual diffing when
DFT_GRAPH_LIMIT is reached.
## 0.40 (released 28th December 2022)
### Diffing

@ -325,7 +325,7 @@ fn diff_file_content(
FileArgument::DevNull => (&lhs_src, Path::new(&lhs_display_path)),
};
let language = language_override.or_else(|| guess(guess_path, guess_src));
let mut language = language_override.or_else(|| guess(guess_path, guess_src));
let lang_config = language.map(tsp::from_language);
if lhs_bytes == rhs_bytes {
@ -414,6 +414,7 @@ fn diff_file_content(
if exceeded_graph_limit {
let lhs_positions = line_parser::change_positions(&lhs_src, &rhs_src);
let rhs_positions = line_parser::change_positions(&rhs_src, &lhs_src);
language = None;
(
Some("Text (exceeded DFT_GRAPH_LIMIT)".into()),
lhs_positions,