From f6414551bb94f67e332f7885ac307754e4afdb61 Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Sat, 8 Apr 2023 21:13:27 -0300 Subject: [PATCH] Prevent variable selection content from being limited to 3 columns (#821) --- src/commands/core/actor.rs | 1 + src/finder/mod.rs | 6 ++++-- src/finder/structures.rs | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commands/core/actor.rs b/src/commands/core/actor.rs index f356273..62bda25 100644 --- a/src/commands/core/actor.rs +++ b/src/commands/core/actor.rs @@ -101,6 +101,7 @@ fn prompt_finder( let mut opts = FinderOpts { preview: Some(preview), + show_all_columns: true, ..initial_opts.clone().unwrap_or_else(FinderOpts::var_default) }; diff --git a/src/finder/mod.rs b/src/finder/mod.rs index f0efa5b..ba33b41 100644 --- a/src/finder/mod.rs +++ b/src/finder/mod.rs @@ -75,8 +75,6 @@ impl FinderChoice { "", "--preview-window", format!("up:{}:nohidden", preview_height).as_str(), - "--with-nth", - "1,2,3", "--delimiter", deser::terminal::DELIMITER.to_string().as_str(), "--ansi", @@ -85,6 +83,10 @@ impl FinderChoice { "--exact", ]); + if !opts.show_all_columns { + command.args(["--with-nth", "1,2,3"]); + } + if !opts.prevent_select1 { if let Self::Fzf = self { command.arg("--select-1"); diff --git a/src/finder/structures.rs b/src/finder/structures.rs index e0581ea..a055194 100644 --- a/src/finder/structures.rs +++ b/src/finder/structures.rs @@ -16,6 +16,7 @@ pub struct Opts { pub column: Option, pub map: Option, pub prevent_select1: bool, + pub show_all_columns: bool, } impl Default for Opts { @@ -34,6 +35,7 @@ impl Default for Opts { delimiter: None, map: None, prevent_select1: true, + show_all_columns: false, } } }