summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-04-20 07:15:58 +0200
committerCanop <cano.petrole@gmail.com>2021-04-20 07:15:58 +0200
commit97ce207e9e2b4928062cd2ef064f2b1a21d1e8e4 (patch)
treed6a3eae1302461182cdc244a72d606cecd8edffa /src/app
parent6da21634bf925b9e3bce497b5d8e6218786f2628 (diff)
parentc19ac0b692e481d6153c92ef6d1d7f9621132cda (diff)
Merge branch 'master' into multiselect
Diffstat (limited to 'src/app')
-rw-r--r--src/app/app.rs8
-rw-r--r--src/app/panel.rs3
-rw-r--r--src/app/panel_state.rs2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/app/app.rs b/src/app/app.rs
index e8f14ce..e9b03a8 100644
--- a/src/app/app.rs
+++ b/src/app/app.rs
@@ -297,7 +297,7 @@ impl App {
}
ClosePanel { validate_purpose, panel_ref } => {
if is_input_invocation {
- self.mut_panel().clear_input_invocation();
+ self.mut_panel().clear_input_invocation(con);
}
let close_idx = self.panel_ref_to_idx(panel_ref)
.unwrap_or_else(||
@@ -391,7 +391,7 @@ impl App {
}
Keep => {
if is_input_invocation {
- self.mut_panel().clear_input_invocation();
+ self.mut_panel().clear_input_invocation(con);
}
}
Launch(launchable) => {
@@ -446,7 +446,7 @@ impl App {
}
RefreshState { clear_cache } => {
if is_input_invocation {
- self.mut_panel().clear_input_invocation();
+ self.mut_panel().clear_input_invocation(con);
}
if clear_cache {
clear_caches();
@@ -511,7 +511,7 @@ impl App {
_ => {}
}
if is_input_invocation {
- self.mut_panel().clear_input_invocation();
+ self.mut_panel().clear_input_invocation(con);
}
let insertion_idx = if purpose.is_preview() {
self.panels.len().get()
diff --git a/src/app/panel.rs b/src/app/panel.rs
index 6d11fd1..26dcf32 100644
--- a/src/app/panel.rs
+++ b/src/app/panel.rs
@@ -162,13 +162,14 @@ impl Panel {
}
/// remove the verb invocation from the input but keep
/// the filter if there's one
- pub fn clear_input_invocation(&mut self) {
+ pub fn clear_input_invocation(&mut self, con: &AppContext) {
let mut command_parts = CommandParts::from(self.input.get_content());
if command_parts.verb_invocation.is_some() {
command_parts.verb_invocation = None;
let new_input = format!("{}", command_parts);
self.input.set_content(&new_input);
}
+ self.mut_state().set_mode(initial_mode(con));
}
pub fn set_input_content(&mut self, content: &str) {
diff --git a/src/app/panel_state.rs b/src/app/panel_state.rs
index d0802b3..67a5921 100644
--- a/src/app/panel_state.rs
+++ b/src/app/panel_state.rs
@@ -77,7 +77,7 @@ pub trait PanelState {
///
/// The invocation comes from the input and may be related
/// to a different verb (the verb may have been triggered
- /// by a key shorctut)
+ /// by a key shortcut)
fn on_internal(
&mut self,
w: &mut W,