Merge pull request #364 from itmecho/feature/skim-optional-exact

Optional exact mode for skim
This commit is contained in:
Denis Isidoro 2020-05-29 09:17:10 -03:00 committed by GitHub
commit 95f746c3cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,6 @@ impl Finder for SkimFinder {
"--ansi",
"--bind",
"ctrl-j:down,ctrl-k:up",
"--exact",
]);
if opts.autoselect {
@ -84,16 +83,27 @@ impl Finder for SkimFinder {
command.args(&["--header-lines", format!("{}", opts.header_lines).as_str()]);
}
let mut exact = true;
if let Some(o) = opts.overrides {
if o.contains("--no-exact") {
exact = false
}
o.as_str()
.split(' ')
.map(|s| s.to_string())
.filter(|s| !s.is_empty())
.filter(|s| s != "--no-exact")
.for_each(|s| {
command.arg(s);
});
}
if exact {
command.arg("--exact");
}
let child = command.stdin(Stdio::piped()).stdout(Stdio::piped()).spawn();
let mut child = match child {