This commit is contained in:
Antonio Scandurra 2022-06-28 08:04:39 +02:00
parent c6e7ae528f
commit 57f34c6992

View file

@ -147,7 +147,7 @@ enum NavigationMode {
GoingBack, GoingBack,
GoingForward, GoingForward,
ClosingItem, ClosingItem,
ReopeningClosed, ReopeningClosedItem,
Disabled, Disabled,
} }
@ -214,7 +214,7 @@ impl Pane {
Self::navigate_history( Self::navigate_history(
workspace, workspace,
workspace.active_pane().clone(), workspace.active_pane().clone(),
NavigationMode::ReopeningClosed, NavigationMode::ReopeningClosedItem,
cx, cx,
) )
} }
@ -968,7 +968,7 @@ impl NavHistory {
NavigationMode::Normal | NavigationMode::Disabled | NavigationMode::ClosingItem => None, NavigationMode::Normal | NavigationMode::Disabled | NavigationMode::ClosingItem => None,
NavigationMode::GoingBack => self.pop_backward(), NavigationMode::GoingBack => self.pop_backward(),
NavigationMode::GoingForward => self.pop_forward(), NavigationMode::GoingForward => self.pop_forward(),
NavigationMode::ReopeningClosed => self.pop_closed(), NavigationMode::ReopeningClosedItem => self.pop_closed(),
} }
} }
@ -979,7 +979,7 @@ impl NavHistory {
pub fn push<D: 'static + Any>(&mut self, data: Option<D>, item: Rc<dyn WeakItemHandle>) { pub fn push<D: 'static + Any>(&mut self, data: Option<D>, item: Rc<dyn WeakItemHandle>) {
match self.mode { match self.mode {
NavigationMode::Disabled => {} NavigationMode::Disabled => {}
NavigationMode::Normal | NavigationMode::ReopeningClosed => { NavigationMode::Normal | NavigationMode::ReopeningClosedItem => {
if self.backward_stack.len() >= MAX_NAVIGATION_HISTORY_LEN { if self.backward_stack.len() >= MAX_NAVIGATION_HISTORY_LEN {
self.backward_stack.pop_front(); self.backward_stack.pop_front();
} }