Skip to content

Commit

Permalink
Fix gitui-org#1473 - correct msg limit in get_commits_intf
Browse files Browse the repository at this point in the history
When sync::get_commits_inf is called in revlog:::fetch_commits, the
message limit used was the length of the list which can be zero at start
up before items are fetched. This results in initial view of the Log
view showing empty messages.
  • Loading branch information
kting28 committed Mar 1, 2023
1 parent 2582992 commit 3b0c222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/commitlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ impl CommitList {
}

///
pub fn current_size(&self) -> (u16, u16) {
self.current_size.get()
}
//pub fn current_size(&self) -> (u16, u16) {
// self.current_size.get()
//}

///
pub fn set_count_total(&mut self, total: usize) {
Expand Down
3 changes: 2 additions & 1 deletion src/tabs/revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use tui::{
};

const SLICE_SIZE: usize = 1200;
static MAX_MESSAGE_WIDTH: usize = 100;

///
pub struct Revlog {
Expand Down Expand Up @@ -160,7 +161,7 @@ impl Revlog {
let commits = sync::get_commits_info(
&self.repo.borrow(),
&self.git_log.get_slice(want_min, SLICE_SIZE)?,
self.list.current_size().0.into(),
MAX_MESSAGE_WIDTH,
);

if let Ok(commits) = commits {
Expand Down

0 comments on commit 3b0c222

Please sign in to comment.