mirror of
https://github.com/denisidoro/navi
synced 2024-11-24 20:43:06 +00:00
parent
9095e376aa
commit
eb146fb3f7
2 changed files with 3 additions and 12 deletions
|
@ -5,7 +5,7 @@ use crate::writer;
|
|||
|
||||
use crate::finder::structures::{Opts as FinderOpts, SuggestionType};
|
||||
use crate::finder::Finder;
|
||||
use crate::shell::{BashSpawnError, IS_FISH};
|
||||
use crate::shell::BashSpawnError;
|
||||
use crate::structures::cheat::{Suggestion, VariableMap};
|
||||
use crate::structures::config::Action;
|
||||
use crate::structures::config::Config;
|
||||
|
@ -71,15 +71,13 @@ fn prompt_finder(
|
|||
let mut opts = FinderOpts {
|
||||
overrides: config.fzf_overrides_var.clone(),
|
||||
preview: Some(format!(
|
||||
r#"{prefix}navi preview-var "$(cat <<NAVIEOF
|
||||
r#"navi preview-var "$(cat <<NAVIEOF
|
||||
{{+}}
|
||||
NAVIEOF
|
||||
)" "$(cat <<NAVIEOF
|
||||
{{q}}
|
||||
NAVIEOF
|
||||
)" "{name}"; {extra}{suffix}"#,
|
||||
prefix = if *IS_FISH { "bash -c '" } else { "" },
|
||||
suffix = if *IS_FISH { "'" } else { "" },
|
||||
)" "{name}"; {extra}"#,
|
||||
name = variable_name,
|
||||
extra = extra_preview.clone().unwrap_or_default()
|
||||
)),
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
use crate::env_var;
|
||||
use std::fmt::Debug;
|
||||
use thiserror::Error;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref IS_FISH: bool = env_var::get("SHELL")
|
||||
.unwrap_or_else(|_| "".to_string())
|
||||
.contains(&"fish");
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Shell {
|
||||
Bash,
|
||||
|
|
Loading…
Reference in a new issue