Skip to content

Commit f27434a

Browse files
committed
Merge branch 'gitui-org:master' into feat-adjusting-size-status-tab
2 parents 59ea16f + 450caed commit f27434a

File tree

9 files changed

+129
-111
lines changed

9 files changed

+129
-111
lines changed

Cargo.lock

Lines changed: 88 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ clippy:
9494
clippy-nightly:
9595
cargo +nightly clippy --workspace --all-features
9696

97-
check: fmt clippy test sort
97+
check: fmt clippy test sort deny
9898

9999
check-nightly:
100100
cargo +nightly c

assets/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

asyncgit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ easy-cast = "0.5"
2424
fuzzy-matcher = "0.3"
2525
git2 = "0.20"
2626
git2-hooks = { path = "../git2-hooks", version = ">=0.6" }
27-
gix = { version = "0.75.0", default-features = false, features = [
27+
gix = { version = "0.77.0", default-features = false, features = [
2828
"max-performance",
2929
"revision",
3030
"mailmap",

asyncgit/src/sync/commits_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub fn get_commit_info(
177177

178178
let message = gix_get_message(&commit_ref, None);
179179

180-
let author = commit_ref.author();
180+
let author = commit_ref.author()?;
181181

182182
let author = mailmap.try_resolve(author).map_or_else(
183183
|| author.name.into(),
@@ -187,7 +187,7 @@ pub fn get_commit_info(
187187
Ok(CommitInfo {
188188
message,
189189
author: author.to_string(),
190-
time: commit_ref.time().seconds,
190+
time: commit_ref.time()?.seconds,
191191
id: commit.id().detach().into(),
192192
})
193193
}

asyncgit/src/sync/status.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ pub fn get_status(
202202
let iter = status.into_index_worktree_iter(Vec::new())?;
203203

204204
for item in iter {
205-
let item = item?;
205+
let Ok(item) = item else {
206+
log::warn!("[status] the status iter returned an error for an item: {item:?}");
207+
208+
continue;
209+
};
206210

207211
let status = item.summary().map(Into::into);
208212

deny.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ ignore = [
2020
# Crate paste is unmaintained. The dependency is already removed in
2121
# ratatui:master. Until a new release is available, ignore this in
2222
# order to pass CI. (https://github.com/gitui-org/gitui/issues/2554)
23-
{ id = "RUSTSEC-2024-0436", reason = "The paste dependency is already removed from ratatui." }
23+
{ id = "RUSTSEC-2024-0436", reason = "The paste dependency is already removed from ratatui." },
24+
# See https://github.com/trishume/syntect/issues/606
25+
{ id = "RUSTSEC-2025-0141", reason = "Only brought in via syntect" },
2426
]
2527

2628
[bans]

src/tabs/revlog.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pub struct Revlog {
7474
key_config: SharedKeyConfig,
7575
sender: Sender<AsyncGitNotification>,
7676
theme: SharedTheme,
77+
commit_list_percentage: u16,
7778
}
7879

7980
impl Revlog {
@@ -107,6 +108,7 @@ impl Revlog {
107108
key_config: env.key_config.clone(),
108109
sender: env.sender_git.clone(),
109110
theme: env.theme.clone(),
111+
commit_list_percentage: 60,
110112
}
111113
}
112114

@@ -424,8 +426,12 @@ impl DrawableComponent for Revlog {
424426
.direction(Direction::Horizontal)
425427
.constraints(
426428
[
427-
Constraint::Percentage(60),
428-
Constraint::Percentage(40),
429+
Constraint::Percentage(
430+
self.commit_list_percentage,
431+
),
432+
Constraint::Percentage(
433+
100 - self.commit_list_percentage,
434+
),
429435
]
430436
.as_ref(),
431437
)
@@ -461,6 +467,20 @@ impl Component for Revlog {
461467
self.commit_details.toggle_visible()?;
462468
self.update()?;
463469
return Ok(EventState::Consumed);
470+
} else if key_match(k, self.key_config.keys.alt_left)
471+
{
472+
if self.commit_list_percentage > 10 {
473+
self.commit_list_percentage -= 5;
474+
self.update()?;
475+
}
476+
return Ok(EventState::Consumed);
477+
} else if key_match(k, self.key_config.keys.alt_right)
478+
{
479+
if self.commit_list_percentage < 90 {
480+
self.commit_list_percentage += 5;
481+
self.update()?;
482+
}
483+
return Ok(EventState::Consumed);
464484
} else if key_match(
465485
k,
466486
self.key_config.keys.exit_popup,

src/tabs/status.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,9 @@ impl Component for Status {
988988
&mut self.vertical_split_index
989989
}
990990
};
991-
if *bottom > 10 {
992-
*top += 5;
993-
*bottom -= 5;
991+
if *top > 10 {
992+
*top -= 5;
993+
*bottom += 5;
994994
}
995995
Ok(EventState::Consumed)
996996
} else if key_match(k, self.key_config.keys.alt_down)
@@ -1003,9 +1003,9 @@ impl Component for Status {
10031003
&mut self.vertical_split_index
10041004
}
10051005
};
1006-
if *top > 10 {
1007-
*top -= 5;
1008-
*bottom += 5;
1006+
if *bottom > 10 {
1007+
*top += 5;
1008+
*bottom -= 5;
10091009
}
10101010
Ok(EventState::Consumed)
10111011
} else {

0 commit comments

Comments
 (0)