summaryrefslogtreecommitdiffstats
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/bulk_rename.rs5
-rw-r--r--src/commands/custom_search.rs2
-rw-r--r--src/commands/fzf.rs6
-rw-r--r--src/commands/open_file.rs6
-rw-r--r--src/commands/show_help.rs3
-rw-r--r--src/commands/sub_process.rs2
-rw-r--r--src/commands/zoxide.rs2
7 files changed, 14 insertions, 12 deletions
diff --git a/src/commands/bulk_rename.rs b/src/commands/bulk_rename.rs
index 9cc7f26..816ff5e 100644
--- a/src/commands/bulk_rename.rs
+++ b/src/commands/bulk_rename.rs
@@ -6,6 +6,7 @@ use std::process;
use rand::Rng;
+use crate::context::remove_external_preview;
use crate::context::AppContext;
use crate::error::{AppError, AppErrorKind, AppResult};
use crate::ui::AppBackend;
@@ -125,10 +126,10 @@ pub fn _bulk_rename(context: &mut AppContext) -> AppResult {
}
pub fn bulk_rename(context: &mut AppContext, backend: &mut AppBackend) -> AppResult {
- context.remove_external_preview();
+ remove_external_preview(context);
backend.terminal_drop();
let res = _bulk_rename(context);
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
reload::soft_reload_curr_tab(context)?;
res
}
diff --git a/src/commands/custom_search.rs b/src/commands/custom_search.rs
index a9d4405..422143e 100644
--- a/src/commands/custom_search.rs
+++ b/src/commands/custom_search.rs
@@ -57,7 +57,7 @@ pub fn custom_search(
.stdout(Stdio::piped())
.spawn()?
.wait_with_output()?;
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
cmd_result
} else {
cmd.output()?
diff --git a/src/commands/fzf.rs b/src/commands/fzf.rs
index 9c60c54..bc4667a 100644
--- a/src/commands/fzf.rs
+++ b/src/commands/fzf.rs
@@ -51,7 +51,7 @@ pub fn fzf_multi(
}
fn fzf_impl(
- context: &mut AppContext,
+ _context: &mut AppContext,
backend: &mut AppBackend,
items: Vec<String>,
args: Vec<String>,
@@ -68,7 +68,7 @@ fn fzf_impl(
let mut fzf = match cmd.spawn() {
Ok(child) => child,
Err(e) => {
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
return Err(AppError::from(e));
}
};
@@ -82,7 +82,7 @@ fn fzf_impl(
}
let fzf_output = fzf.wait_with_output();
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
if let Ok(output) = fzf_output {
if output.status.success() {
diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs
index d206f35..0d248e9 100644
--- a/src/commands/open_file.rs
+++ b/src/commands/open_file.rs
@@ -60,7 +60,7 @@ where
} else {
backend.terminal_drop();
let res = execute_and_wait(option, files);
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
res?;
}
Ok(())
@@ -79,7 +79,7 @@ fn _open_with_xdg(
backend.terminal_drop();
let handle = open::that_in_background(path);
let result = handle.join();
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
if let Ok(result) = result {
result?;
}
@@ -136,7 +136,7 @@ where
let mut option = ProgramEntry::new(String::from(cmd));
option.args(args_iter);
let res = execute_and_wait(&option, files);
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
res?
}
}
diff --git a/src/commands/show_help.rs b/src/commands/show_help.rs
index d77dd63..6c98f79 100644
--- a/src/commands/show_help.rs
+++ b/src/commands/show_help.rs
@@ -3,6 +3,7 @@ use std::cmp::Ordering;
use termion::event::{Event, Key};
use crate::config::clean::keymap::AppKeyMapping;
+use crate::context::remove_external_preview;
use crate::context::AppContext;
use crate::error::AppResult;
use crate::event::process_event;
@@ -30,7 +31,7 @@ pub fn help_loop(
widgets::get_keymap_table(&keymap_t.default_view, &search_query[1..], sort_by)
};
- context.remove_external_preview();
+ remove_external_preview(context);
backend.render(TuiHelp::new(&keymap, &mut offset, &search_query));
let event = match context.poll_event() {
diff --git a/src/commands/sub_process.rs b/src/commands/sub_process.rs
index e1a5262..2e5a1c8 100644
--- a/src/commands/sub_process.rs
+++ b/src/commands/sub_process.rs
@@ -126,7 +126,7 @@ pub fn sub_process(
// shell command and restore it afterwards
backend.terminal_drop();
execute_sub_process(context, words, mode)?;
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
let _ = reload::soft_reload_curr_tab(context);
context
.message_queue_mut()
diff --git a/src/commands/zoxide.rs b/src/commands/zoxide.rs
index a065117..222bb9d 100644
--- a/src/commands/zoxide.rs
+++ b/src/commands/zoxide.rs
@@ -49,7 +49,7 @@ pub fn zoxide_query_interactive(context: &mut AppContext, backend: &mut AppBacke
.spawn()?;
let zoxide_output = zoxide_process.wait_with_output()?;
- backend.terminal_restore(context.config_ref().mouse_support)?;
+ backend.terminal_restore()?;
if zoxide_output.status.success() {
if let Ok(zoxide_str) = std::str::from_utf8(&zoxide_output.stdout) {