Fix two issues with diff highlights (#24309)
* fix syntax highlighting of deleted text when buffer language changes * do not highlight entire untracked files as created, except in the project diff view Release Notes: - N/A Co-authored-by: ConradIrwin <conrad.irwin@gmail.com> Co-authored-by: cole-miller <m@cole-miller.net>
This commit is contained in:
parent
9114ca973c
commit
ca01a8b9cb
5 changed files with 126 additions and 52 deletions
|
@ -74,6 +74,18 @@ impl BufferDiff {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_with_single_insertion(buffer: &BufferSnapshot) -> Self {
|
||||
Self {
|
||||
tree: SumTree::from_item(
|
||||
InternalDiffHunk {
|
||||
buffer_range: Anchor::MIN..Anchor::MAX,
|
||||
diff_base_byte_range: 0..0,
|
||||
},
|
||||
buffer,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build(diff_base: Option<&str>, buffer: &text::BufferSnapshot) -> Self {
|
||||
let mut tree = SumTree::new(buffer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue