diff options
author | Tim Oram <dev@mitmaro.ca> | 2020-08-04 23:54:05 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2020-09-01 22:41:19 -0230 |
commit | c28186e99730f82bac3ada8d729825e285752371 (patch) | |
tree | bd635cfde551b1915f0d66a279d216a7f5e793fa /src/show_commit/mod.rs | |
parent | b016af7ac5e3afedaaa646d3b785eed365918eff (diff) |
Ensure rebuild of ViewData
There were a few places where the ViewData was not rebuilt, causing
some renders to display stale data. This ensures that the view data is
rebuilt in all cases.
Diffstat (limited to 'src/show_commit/mod.rs')
-rw-r--r-- | src/show_commit/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/show_commit/mod.rs b/src/show_commit/mod.rs index 0978cd7..633b157 100644 --- a/src/show_commit/mod.rs +++ b/src/show_commit/mod.rs @@ -66,10 +66,10 @@ impl<'s> ProcessModule for ShowCommit<'s> { } fn build_view_data(&mut self, view: &View<'_>, _: &GitInteractive) -> &ViewData { + let (view_width, view_height) = view.get_view_size(); match &self.commit { Some(commit) => { if self.view_data.is_empty() { - let (view_width, view_height) = view.get_view_size(); let is_full_width = view_width >= MINIMUM_FULL_WINDOW_WIDTH; let commit = commit.as_ref().unwrap(); // if commit is error it will be caught in process @@ -107,7 +107,11 @@ impl<'s> ProcessModule for ShowCommit<'s> { } &self.view_data }, - None => &self.no_commit_view_data, + None => { + self.no_commit_view_data.set_view_size(view_width, view_height); + self.no_commit_view_data.rebuild(); + &self.no_commit_view_data + }, } } |