Skip to content

Commit

Permalink
Prevent variable selection content from being limited to 3 columns (#821
Browse files Browse the repository at this point in the history
)
  • Loading branch information
denisidoro committed Apr 9, 2023
1 parent 8963749 commit f641455
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/commands/core/actor.rs
Expand Up @@ -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)
};

Expand Down
6 changes: 4 additions & 2 deletions src/finder/mod.rs
Expand Up @@ -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",
Expand All @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions src/finder/structures.rs
Expand Up @@ -16,6 +16,7 @@ pub struct Opts {
pub column: Option<u8>,
pub map: Option<String>,
pub prevent_select1: bool,
pub show_all_columns: bool,
}

impl Default for Opts {
Expand All @@ -34,6 +35,7 @@ impl Default for Opts {
delimiter: None,
map: None,
prevent_select1: true,
show_all_columns: false,
}
}
}
Expand Down

0 comments on commit f641455

Please sign in to comment.