mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
internal: Improve reporting of intersecting changes
This commit is contained in:
parent
8925544998
commit
b4f2d62952
3 changed files with 142 additions and 8 deletions
|
|
@ -421,8 +421,8 @@ pub fn format_diff(chunks: Vec<dissimilar::Chunk<'_>>) -> String {
|
|||
for chunk in chunks {
|
||||
let formatted = match chunk {
|
||||
dissimilar::Chunk::Equal(text) => text.into(),
|
||||
dissimilar::Chunk::Delete(text) => format!("\x1b[41m{text}\x1b[0m"),
|
||||
dissimilar::Chunk::Insert(text) => format!("\x1b[42m{text}\x1b[0m"),
|
||||
dissimilar::Chunk::Delete(text) => format!("\x1b[41m{text}\x1b[0m\x1b[K"),
|
||||
dissimilar::Chunk::Insert(text) => format!("\x1b[42m{text}\x1b[0m\x1b[K"),
|
||||
};
|
||||
buf.push_str(&formatted);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue