pub fn show_write_preview<W: Write>(
stdout: &mut W,
path: &str,
new_content: &str,
) -> Result<(), Box<dyn Error>>Expand description
Show a unified-diff-style view of a write operation (full file). If the file already exists, reads it and shows a line-by-line diff with removed lines in red and added lines in green. If the file is new, shows a preview of the content that will be written.