Add test for reopening closed items

This commit is contained in:
Antonio Scandurra 2022-06-27 17:59:25 +02:00
parent 0652542f60
commit c6e7ae528f
2 changed files with 168 additions and 4 deletions

View file

@ -83,7 +83,9 @@ pub fn init(cx: &mut MutableAppContext) {
cx.add_action(|pane: &mut Pane, _: &SplitUp, cx| pane.split(SplitDirection::Up, cx));
cx.add_action(|pane: &mut Pane, _: &SplitRight, cx| pane.split(SplitDirection::Right, cx));
cx.add_action(|pane: &mut Pane, _: &SplitDown, cx| pane.split(SplitDirection::Down, cx));
cx.add_action(Pane::reopen_closed_item);
cx.add_action(|workspace: &mut Workspace, _: &ReopenClosedItem, cx| {
Pane::reopen_closed_item(workspace, cx).detach();
});
cx.add_action(|workspace: &mut Workspace, action: &GoBack, cx| {
Pane::go_back(
workspace,
@ -207,16 +209,14 @@ impl Pane {
pub fn reopen_closed_item(
workspace: &mut Workspace,
_: &ReopenClosedItem,
cx: &mut ViewContext<Workspace>,
) {
) -> Task<()> {
Self::navigate_history(
workspace,
workspace.active_pane().clone(),
NavigationMode::ReopeningClosed,
cx,
)
.detach();
}
fn navigate_history(