summaryrefslogtreecommitdiffstats
path: root/src/launchable.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-03-27 08:23:44 +0200
committerCanop <cano.petrole@gmail.com>2022-03-27 08:23:44 +0200
commit68ca143c0d8f5a8b871cafc7e283423a113f6959 (patch)
tree40a3284e25f63d3bc2801cbd4ca9d1b5eb53cbf8 /src/launchable.rs
parentf9fe6efebf3ce4e32d93705db8decc2019f7112f (diff)
add the (already documented) capture_mouse conf item
See https://github.com/Canop/broot/issues/238
Diffstat (limited to 'src/launchable.rs')
-rw-r--r--src/launchable.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/launchable.rs b/src/launchable.rs
index 7c602d0..9378cb2 100644
--- a/src/launchable.rs
+++ b/src/launchable.rs
@@ -52,7 +52,7 @@ pub enum Launchable {
exe: String,
args: Vec<String>,
working_dir: Option<PathBuf>,
- mouse_capture_disabled: bool,
+ capture_mouse: bool,
},
/// open a path
@@ -110,7 +110,7 @@ impl Launchable {
exe,
args: parts.collect(),
working_dir,
- mouse_capture_disabled: con.mouse_capture_disabled,
+ capture_mouse: con.capture_mouse,
}),
None => Err(io::Error::new(io::ErrorKind::Other, "Empty launch string")),
}
@@ -133,7 +133,7 @@ impl Launchable {
working_dir,
exe,
args,
- mouse_capture_disabled,
+ capture_mouse,
} => {
debug!("working_dir: {:?}", &working_dir);
// we restore the normal terminal in case the executable
@@ -143,7 +143,7 @@ impl Launchable {
if let Some(ref mut w) = &mut w {
w.queue(cursor::Show).unwrap();
w.queue(LeaveAlternateScreen).unwrap();
- if !mouse_capture_disabled {
+ if *capture_mouse {
w.queue(DisableMouseCapture).unwrap();
}
terminal::disable_raw_mode().unwrap();
@@ -164,7 +164,7 @@ impl Launchable {
});
if let Some(ref mut w) = &mut w {
terminal::enable_raw_mode().unwrap();
- if !mouse_capture_disabled {
+ if *capture_mouse {
w.queue(EnableMouseCapture).unwrap();
}
w.queue(EnterAlternateScreen).unwrap();