summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Isidoro <denisidoro@users.noreply.github.com>2022-11-15 17:26:00 -0300
committerGitHub <noreply@github.com>2022-11-15 17:26:00 -0300
commit13fe757a8a4cd54757393fc082a388b9441f10cc (patch)
tree826f94fd25672d660f7dfa5c5167de320f3189bc /src
parent0c824199341ade036f967589143cd33820c613d4 (diff)
parent41aa47e280db40c6592183e598b4533f9d313d56 (diff)
Merge pull request #776 from trantor/preview_fix
Fix preview map "leaking" with multiple variables
Diffstat (limited to 'src')
-rw-r--r--src/commands/preview/var.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/commands/preview/var.rs b/src/commands/preview/var.rs
index 8dd809b..14880bf 100644
--- a/src/commands/preview/var.rs
+++ b/src/commands/preview/var.rs
@@ -90,8 +90,14 @@ impl Runnable for Input {
"{variables}\n{variable} = {value}",
variables = variables,
variable = style(variable_name).with(variable_color),
- value = finder::process(value, column, delimiter.as_deref(), map.clone())
- .expect("Unable to process value"),
+ value = if env_var::get(&env_variable_name).is_ok() {
+ value
+ } else if is_current {
+ finder::process(value, column, delimiter.as_deref(), map.clone())
+ .expect("Unable to process value")
+ } else {
+ "".to_string()
+ }
);
}