Add _ZO_FZF_OPTS_FILE environment variable
zoxide now recognizes `_ZO_FZF_OPTS_FILE` environment variable, in addition to `_ZO_FZF_OPTS`.
This commit is contained in:
parent
67ca1bc959
commit
a96dc1aa41
|
|
@ -92,6 +92,11 @@ impl Query {
|
||||||
|
|
||||||
fn get_fzf() -> Result<FzfChild> {
|
fn get_fzf() -> Result<FzfChild> {
|
||||||
let mut fzf = Fzf::new()?;
|
let mut fzf = Fzf::new()?;
|
||||||
|
|
||||||
|
if let Some(fzf_opts_file) = config::fzf_opts_file() {
|
||||||
|
fzf.env("FZF_DEFAULT_OPTS_FILE", fzf_opts_file);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(fzf_opts) = config::fzf_opts() {
|
if let Some(fzf_opts) = config::fzf_opts() {
|
||||||
fzf.env("FZF_DEFAULT_OPTS", fzf_opts)
|
fzf.env("FZF_DEFAULT_OPTS", fzf_opts)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,11 @@ pub fn fzf_opts() -> Option<OsString> {
|
||||||
env::var_os("_ZO_FZF_OPTS")
|
env::var_os("_ZO_FZF_OPTS")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn fzf_opts_file() -> Option<OsString> {
|
||||||
|
env::var_os("_ZO_FZF_OPTS_FILE")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pub fn maxage() -> Result<Rank> {
|
pub fn maxage() -> Result<Rank> {
|
||||||
env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| {
|
env::var_os("_ZO_MAXAGE").map_or(Ok(10_000.0), |maxage| {
|
||||||
let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?;
|
let maxage = maxage.to_str().context("invalid unicode in _ZO_MAXAGE")?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue