Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl App {
filter_regex: Option<String>,
find_regex: Option<String>,
freeze_cols_offset: Option<u64>,
color_columns: bool,
no_color_columns: bool,
prompt: Option<String>,
wrap_mode: Option<WrapMode>,
) -> CsvlensResult<Self> {
Expand Down Expand Up @@ -223,7 +223,7 @@ impl App {
rows_view.headers().len(),
&echo_column,
ignore_case,
color_columns,
no_color_columns,
prompt,
);

Expand Down
10 changes: 5 additions & 5 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ struct Args {
echo_column: Option<String>,

/// Whether to display each column in a different color
#[arg(long, alias = "colorful", visible_alias = "colorful")]
color_columns: bool,
#[arg(long, alias = "no-color", visible_alias = "no-color")]
no_color_columns: bool,

/// Show a custom prompt message in the status bar. Supports ANSI escape codes for colored or
/// styled text.
Expand Down Expand Up @@ -146,7 +146,7 @@ impl From<Args> for CsvlensOptions {
echo_column: args.echo_column,
debug: args.debug,
freeze_cols_offset: None,
color_columns: args.color_columns,
no_color_columns: args.no_color_columns,
prompt: args.prompt,
wrap_mode: Args::get_wrap_mode(args.wrap, args.wrap_chars, args.wrap_words),
}
Expand All @@ -167,7 +167,7 @@ pub struct CsvlensOptions {
pub echo_column: Option<String>,
pub debug: bool,
pub freeze_cols_offset: Option<u64>,
pub color_columns: bool,
pub no_color_columns: bool,
pub prompt: Option<String>,
pub wrap_mode: Option<WrapMode>,
}
Expand Down Expand Up @@ -254,7 +254,7 @@ pub fn run_csvlens_with_options(options: CsvlensOptions) -> CsvlensResult<Option
options.filter,
options.find,
options.freeze_cols_offset,
options.color_columns,
options.no_color_columns,
options.prompt,
options.wrap_mode,
)?;
Expand Down
8 changes: 4 additions & 4 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl<'a> CsvTable<'a> {
}
let effective_width = min(remaining_width, hlen);
let mut content_style = Style::default();
if state.color_columns {
if !state.no_color_columns {
content_style = content_style
.fg(state.theme.column_colors[col_index % state.theme.column_colors.len()]);
}
Expand Down Expand Up @@ -1260,7 +1260,7 @@ pub struct CsvTableState {
pub column_width_overrides: ColumnWidthOverrides,
pub cursor_xy: Option<(u16, u16)>,
pub theme: Theme,
pub color_columns: bool,
pub no_color_columns: bool,
pub prompt: Option<String>,
pub debug: String,
}
Expand All @@ -1271,7 +1271,7 @@ impl CsvTableState {
total_cols: usize,
echo_column: &Option<String>,
ignore_case: bool,
color_columns: bool,
no_color_columns: bool,
prompt: Option<String>,
) -> Self {
Self {
Expand Down Expand Up @@ -1299,7 +1299,7 @@ impl CsvTableState {
column_width_overrides: ColumnWidthOverrides::new(),
cursor_xy: None,
theme: Theme::default(),
color_columns,
no_color_columns,
prompt,
debug: "".into(),
}
Expand Down