Use a proper action when clicking navigate forward button (#4115)

Deals with https://github.com/zed-industries/community/issues/2428

Release Notes:

- Fixed navigate forward button on click navigating backwards instead
This commit is contained in:
Kirill Bulatov 2024-01-18 11:43:03 +02:00 committed by GitHub
commit 82b48a6a7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,7 +195,7 @@ struct NavHistoryState {
next_timestamp: Arc<AtomicUsize>,
}
#[derive(Copy, Clone)]
#[derive(Debug, Copy, Clone)]
pub enum NavigationMode {
Normal,
GoingBack,
@ -1462,7 +1462,7 @@ impl Pane {
.icon_size(IconSize::Small)
.on_click({
let view = cx.view().clone();
move |_, cx| view.update(cx, Self::navigate_backward)
move |_, cx| view.update(cx, Self::navigate_forward)
})
.disabled(!self.can_navigate_forward())
.tooltip(|cx| Tooltip::for_action("Go Forward", &GoForward, cx)),