Activate last item if item's number is greater than the last one's (#31471)
Release Notes: - N/A
This commit is contained in:
parent
e84463648a
commit
fe0bcd14d2
1 changed files with 8 additions and 2 deletions
|
@ -3249,12 +3249,18 @@ impl Render for Pane {
|
|||
.on_action(cx.listener(Pane::toggle_zoom))
|
||||
.on_action(
|
||||
cx.listener(|pane: &mut Pane, action: &ActivateItem, window, cx| {
|
||||
pane.activate_item(action.0, true, true, window, cx);
|
||||
pane.activate_item(
|
||||
action.0.min(pane.items.len().saturating_sub(1)),
|
||||
true,
|
||||
true,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
}),
|
||||
)
|
||||
.on_action(
|
||||
cx.listener(|pane: &mut Pane, _: &ActivateLastItem, window, cx| {
|
||||
pane.activate_item(pane.items.len() - 1, true, true, window, cx);
|
||||
pane.activate_item(pane.items.len().saturating_sub(1), true, true, window, cx);
|
||||
}),
|
||||
)
|
||||
.on_action(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue