From 16ff1380a833c46b1be889c9440281c1a97aee4f Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Thu, 13 Feb 2025 12:01:56 +0100 Subject: [PATCH] feat(bin): Stateful hunk items can be updated --- bin/ui/items.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ui/items.rs b/bin/ui/items.rs index cd80c387..a67f2204 100644 --- a/bin/ui/items.rs +++ b/bin/ui/items.rs @@ -1607,6 +1607,10 @@ impl<'a> StatefulHunkItem<'a> { pub fn state(&self) -> &HunkState { &self.1 } + + pub fn update_state(&mut self, state: &HunkState) { + self.1 = state.clone(); + } } pub struct HighlightedLine<'a>(Line<'a>);