summaryrefslogtreecommitdiffstats
path: root/src/stage
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-04-17 10:26:26 +0200
committerCanop <cano.petrole@gmail.com>2021-04-17 10:26:26 +0200
commitccce368ea81ea1aa070557ff984a04b6c1449960 (patch)
treef9c7f6d3d84274fa0755009a310fb5fe2b10ea62 /src/stage
parentf925993a6bbacbf92befdf1d825de982ba094fdf (diff)
:open_staging_area and :close_staging_area
Diffstat (limited to 'src/stage')
-rw-r--r--src/stage/stage_state.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/stage/stage_state.rs b/src/stage/stage_state.rs
index 5e78c1e..f3208d5 100644
--- a/src/stage/stage_state.rs
+++ b/src/stage/stage_state.rs
@@ -79,6 +79,7 @@ impl PanelState for StageState {
in_new_panel: bool,
con: &AppContext,
) -> CmdResult {
+ // FIXME we must register the options, at least
// TODO implement: sorting, etc.
CmdResult::Keep
}
@@ -264,7 +265,15 @@ impl PanelState for StageState {
Ok(if refresh {
CmdResult::RefreshState { clear_cache: true }
} else {
- CmdResult::Keep
+ app_state.stage.refresh();
+ if app_state.stage.is_empty() {
+ CmdResult::ClosePanel {
+ validate_purpose: false,
+ panel_ref: PanelReference::Active,
+ }
+ } else {
+ CmdResult::Keep
+ }
})
}
}