mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
fix(diff): a read that failed must not overwrite the sidebar's counts
The overlay says "could not read the diff" in words, and then published the failed read's zero totals over the +N -N the row already had right.
This commit is contained in:
@@ -185,7 +185,12 @@ impl Tty7App {
|
||||
// +N −N asks, and it is the one the reader is looking at. Hand the
|
||||
// numbers back before anything renders, or the row can disagree with
|
||||
// the overlay it just opened.
|
||||
let mut landed = if let Some(snap) = snap.as_ref() {
|
||||
//
|
||||
// A read that failed is not an answer at all: its totals are whatever
|
||||
// got parsed before git gave up, usually zero. Publishing those wipes
|
||||
// the counts the sidebar already had right — the overlay says so in
|
||||
// words a few lines below, and the row would silently disagree.
|
||||
let mut landed = if let Some(snap) = snap.as_ref().filter(|s| !s.read_failed) {
|
||||
let (added, removed) = snap.totals();
|
||||
let root = snap.root.clone();
|
||||
cx.default_global::<crate::terminal::git_status::GitStatusCache>();
|
||||
|
||||
Reference in New Issue
Block a user