diff options
author | Canop <cano.petrole@gmail.com> | 2021-04-17 10:26:26 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-04-17 10:26:26 +0200 |
commit | ccce368ea81ea1aa070557ff984a04b6c1449960 (patch) | |
tree | f9c7f6d3d84274fa0755009a310fb5fe2b10ea62 /src/stage | |
parent | f925993a6bbacbf92befdf1d825de982ba094fdf (diff) |
:open_staging_area and :close_staging_area
Diffstat (limited to 'src/stage')
-rw-r--r-- | src/stage/stage_state.rs | 11 |
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 + } }) } } |