mirror of
https://github.com/denisidoro/navi
synced 2024-11-23 03:53:05 +00:00
Merge pull request #255 from mrVanDalo/feature/prompt-suggesions
add variable name to prompt with suggestions
This commit is contained in:
commit
e99e1511e5
1 changed files with 3 additions and 1 deletions
|
@ -56,6 +56,7 @@ fn extract_from_selections(raw_output: &str, contains_key: bool) -> (&str, &str,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prompt_with_suggestions(
|
fn prompt_with_suggestions(
|
||||||
|
varname: &str,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
suggestion: &cheat::Value,
|
suggestion: &cheat::Value,
|
||||||
values: &HashMap<String, String>,
|
values: &HashMap<String, String>,
|
||||||
|
@ -80,6 +81,7 @@ fn prompt_with_suggestions(
|
||||||
preview: false,
|
preview: false,
|
||||||
autoselect: !config.no_autoselect,
|
autoselect: !config.no_autoselect,
|
||||||
overrides: config.fzf_overrides_var.as_ref(),
|
overrides: config.fzf_overrides_var.as_ref(),
|
||||||
|
prompt: Some(display::variable_prompt(varname)),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,7 +154,7 @@ fn replace_variables_from_snippet(
|
||||||
let k = format!("{};{}", tags, varname);
|
let k = format!("{};{}", tags, varname);
|
||||||
|
|
||||||
let value = match variables.get(&k[..]) {
|
let value = match variables.get(&k[..]) {
|
||||||
Some(suggestion) => prompt_with_suggestions(&config, suggestion, &values),
|
Some(suggestion) => prompt_with_suggestions(varname, &config, suggestion, &values),
|
||||||
None => prompt_without_suggestions(varname),
|
None => prompt_without_suggestions(varname),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue