brain: Require hunk focus for acceptance

a5264f254ce6b2327a4ad1b89913611fbd36946f
Alexis Sellier committed ago 1 parent 23e95813
crates/brain/src/session.rs +1 -4
501 501
        } else {
502 502
            Ok(Control::Continue)
503 503
        }
504 504
    }
505 505
506 -
    /// Persists acceptance of the focused hunk, or focuses one when none is.
506 +
    /// Toggles acceptance of the focused hunk.
507 507
    ///
508 508
    /// Acceptance updates exact persisted identity state before reconciliation.
509 509
    fn toggle_focused_hunk(&mut self, area: Rect) -> Result<(), Error> {
510 510
        let loaded = self.current()?;
511 511
        let Some(DiffFocus::Hunk(hunk)) = loaded.viewer.state().focus else {
512 -
            // No hunk is focused yet: move focus to the first hunk so the next
513 -
            // toggle has an unambiguous target.
514 -
            loaded.viewer.apply(DiffAction::NextHunk, area);
515 512
            return Ok(());
516 513
        };
517 514
        if !loaded.identities.contains_key(&hunk) {
518 515
            return Ok(());
519 516
        }
a.rs +0 -0