mirror of
https://github.com/denisidoro/navi
synced 2024-11-22 11:33:10 +00:00
Make --exact optional for skim by having --no-exact in the NAVI_FZF_OVERRIDES environment variable
This commit is contained in:
parent
317cc34016
commit
1d65f73994
1 changed files with 11 additions and 1 deletions
|
@ -31,7 +31,6 @@ impl Finder for SkimFinder {
|
||||||
"--ansi",
|
"--ansi",
|
||||||
"--bind",
|
"--bind",
|
||||||
"ctrl-j:down,ctrl-k:up",
|
"ctrl-j:down,ctrl-k:up",
|
||||||
"--exact",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if opts.autoselect {
|
if opts.autoselect {
|
||||||
|
@ -84,16 +83,27 @@ impl Finder for SkimFinder {
|
||||||
command.args(&["--header-lines", format!("{}", opts.header_lines).as_str()]);
|
command.args(&["--header-lines", format!("{}", opts.header_lines).as_str()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut exact = true;
|
||||||
|
|
||||||
if let Some(o) = opts.overrides {
|
if let Some(o) = opts.overrides {
|
||||||
|
if o.contains("--no-exact") {
|
||||||
|
exact = false
|
||||||
|
}
|
||||||
|
|
||||||
o.as_str()
|
o.as_str()
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.map(|s| s.to_string())
|
.map(|s| s.to_string())
|
||||||
.filter(|s| !s.is_empty())
|
.filter(|s| !s.is_empty())
|
||||||
|
.filter(|s| s != "--no-exact")
|
||||||
.for_each(|s| {
|
.for_each(|s| {
|
||||||
command.arg(s);
|
command.arg(s);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if exact {
|
||||||
|
command.arg("--exact");
|
||||||
|
}
|
||||||
|
|
||||||
let child = command.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn();
|
let child = command.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn();
|
||||||
|
|
||||||
let mut child = match child {
|
let mut child = match child {
|
||||||
|
|
Loading…
Reference in a new issue