summaryrefslogtreecommitdiffstats
path: root/src/skim.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-10-18 06:56:28 +0200
committerqkzk <qu3nt1n@gmail.com>2023-10-18 06:56:28 +0200
commita8715f9e7c7c5f6be9951d00925a1e3761f7e6cb (patch)
treead0ff1dfd1339f79ac56a92c74a4c993559450d3 /src/skim.rs
parent21f816f414453c6add452f86bae9ac5c821111e4 (diff)
second pane follow. Not clean, makes skim hang
Diffstat (limited to 'src/skim.rs')
-rw-r--r--src/skim.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/skim.rs b/src/skim.rs
index f35b0eb..b78041e 100644
--- a/src/skim.rs
+++ b/src/skim.rs
@@ -44,11 +44,11 @@ impl Skimer {
/// Call skim on its term.
/// Returns the file whose line match a pattern from current folder using ripgrep or grep.
- pub fn search_line_in_file(&self) -> Vec<Arc<dyn SkimItem>> {
+ pub fn search_line_in_file(&self, path_str: &str) -> Vec<Arc<dyn SkimItem>> {
self.skim
.run_internal(
None,
- "".to_owned(),
+ path_str.to_owned(),
None,
Some(self.file_matcher.to_owned()),
)
@@ -89,7 +89,9 @@ impl SkimItem for StringWrapper {
fn pick_first_installed<'a>(commands: &'a [&'a str]) -> Option<&'a str> {
for command in commands {
- let Some(program) = command.split_whitespace().next() else { continue };
+ let Some(program) = command.split_whitespace().next() else {
+ continue;
+ };
if is_program_in_path(program) {
return Some(command);
}