mirror of
https://github.com/denisidoro/navi
synced 2024-11-15 00:07:21 +00:00
Allow overriding FZF variables (#235)
`$FZF_DEFAULT_OPTS` won't work in some use cases because it has lower precedence then hardcoded settings such as `--exact`. Usage: ``` export NAVI_FZF_OVERRIDES=" --no-exact" navi ``` Fixes #232
This commit is contained in:
parent
7ae019cf0e
commit
ce9c22100a
5 changed files with 18 additions and 11 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -89,7 +89,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "navi"
|
||||
version = "2.0.5"
|
||||
version = "2.0.6"
|
||||
dependencies = [
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"raw_tty 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "navi"
|
||||
version = "2.0.5"
|
||||
version = "2.0.6"
|
||||
authors = ["Denis Isidoro <denis_isidoro@live.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
13
scripts/fix
13
scripts/fix
|
@ -4,14 +4,19 @@ set -euo pipefail
|
|||
export NAVI_HOME="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
source "${NAVI_HOME}/scripts/install"
|
||||
|
||||
cd "$NAVI_HOME"
|
||||
|
||||
header "Cargo nighly fix..."
|
||||
cargo +nightly fix --clippy -Z unstable-options 2> /dev/null || true
|
||||
cargo +nightly fix --clippy -Z unstable-options || true
|
||||
|
||||
header "Cargo fix..."
|
||||
cargo fix 2> /dev/null || true
|
||||
cargo fix || true
|
||||
|
||||
header "Cargo fmt..."
|
||||
cargo fmt 2> /dev/null || true
|
||||
cargo fmt || true
|
||||
|
||||
header "dot code beautify..."
|
||||
find scripts -type f | xargs -I% dot code beautify 2> /dev/null || true
|
||||
find scripts -type f | xargs -I% dot code beautify % || true
|
||||
|
||||
header "clippy..."
|
||||
cargo clippy || true
|
||||
|
|
|
@ -65,6 +65,7 @@ fn prompt_with_suggestions(config: &Config, suggestion: &cheat::Value) -> String
|
|||
let mut opts = fzf::Opts {
|
||||
preview: false,
|
||||
autoselect: !config.no_autoselect,
|
||||
overrides: config.fzf_overrides_var.as_ref(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
|
|
@ -34,13 +34,14 @@ pub struct Config {
|
|||
#[structopt(long)]
|
||||
pub no_preview: bool,
|
||||
|
||||
// #[structopt(long)]
|
||||
// pub col_widths: Option<String>,
|
||||
/// Overrides for fzf commands (must start with an empty space)
|
||||
#[structopt(long)]
|
||||
#[structopt(long)]
|
||||
/// FZF overrides for cheat selection (must start with an empty space)
|
||||
#[structopt(long, env = "NAVI_FZF_OVERRIDES")]
|
||||
pub fzf_overrides: Option<String>,
|
||||
|
||||
/// FZF overrides for variable selection (must start with an empty space)
|
||||
#[structopt(long, env = "NAVI_FZF_OVERRIDES_VAR")]
|
||||
pub fzf_overrides_var: Option<String>,
|
||||
|
||||
#[structopt(subcommand)]
|
||||
pub cmd: Option<Command>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue