gets new _ZO_FZF_EXTRA_OPTS and add it to the fzf flags when _ZO_FZF_OPTS exist
This commit is contained in:
parent
2ecb310108
commit
efac8588e9
|
|
@ -91,7 +91,12 @@ impl Query {
|
|||
|
||||
fn get_fzf() -> Result<FzfChild> {
|
||||
let mut fzf = Fzf::new()?;
|
||||
if let Some(fzf_opts) = config::fzf_opts() {
|
||||
if let Some(mut fzf_opts) = config::fzf_opts() {
|
||||
if let Some(fzf_extra_opts) = config::fzf_extra_opts() {
|
||||
fzf_opts.push(" ");
|
||||
fzf_opts.push(fzf_extra_opts);
|
||||
}
|
||||
|
||||
fzf.env("FZF_DEFAULT_OPTS", fzf_opts)
|
||||
} else {
|
||||
fzf.args([
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ pub fn fzf_opts() -> Option<OsString> {
|
|||
env::var_os("_ZO_FZF_OPTS")
|
||||
}
|
||||
|
||||
pub fn fzf_extra_opts() -> Option<OsString> {
|
||||
env::var_os("_ZO_FZF_EXTRA_OPTS")
|
||||
}
|
||||
|
||||
pub fn maxage() -> Result<Rank> {
|
||||
env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| {
|
||||
let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue