mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
update diff after commit
This commit is contained in:
parent
3ce4a51b04
commit
55e9fe643b
2 changed files with 8 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ impl App {
|
||||||
pub fn event(&mut self, ev: Event) {
|
pub fn event(&mut self, ev: Event) {
|
||||||
trace!("event: {:?}", ev);
|
trace!("event: {:?}", ev);
|
||||||
if self.commit.event(ev) {
|
if self.commit.event(ev) {
|
||||||
|
self.update_diff();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +222,8 @@ impl App {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
self.diff.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@ impl DiffComponent {
|
||||||
self.current_path.clone()
|
self.current_path.clone()
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
|
pub fn clear(&mut self) {
|
||||||
|
self.current_path.clear();
|
||||||
|
self.diff = Diff::default();
|
||||||
|
}
|
||||||
|
///
|
||||||
pub fn update(&mut self, path: String, diff: Diff) {
|
pub fn update(&mut self, path: String, diff: Diff) {
|
||||||
self.current_path = path;
|
self.current_path = path;
|
||||||
if diff != self.diff {
|
if diff != self.diff {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue