From 85f591b75297c085ba321e869b1d3a63a0d4837d Mon Sep 17 00:00:00 2001 From: Catherine Noll Date: Sun, 21 Mar 2021 12:50:45 -0500 Subject: Send navigation command to less on --show-themes --- src/bat_utils/output.rs | 3 +++ src/config.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/bat_utils/output.rs b/src/bat_utils/output.rs index 26cd4e21..388bc0c9 100644 --- a/src/bat_utils/output.rs +++ b/src/bat_utils/output.rs @@ -137,6 +137,9 @@ delta is not an appropriate value for $PAGER \ navigate::copy_less_hist_file_and_append_navigate_regexp(config) { process.env("LESSHISTFILE", hist_file); + if config.show_themes { + process.arg("+n"); + } } } Ok(process diff --git a/src/config.rs b/src/config.rs index eaa295ea..f822efc2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -70,6 +70,7 @@ pub struct Config { pub plus_style: Style, pub git_minus_style: Style, pub git_plus_style: Style, + pub show_themes: bool, pub side_by_side: bool, pub side_by_side_data: side_by_side::SideBySideData, pub syntax_dummy_theme: SyntaxTheme, @@ -234,6 +235,7 @@ impl From for Config { plus_style, git_minus_style, git_plus_style, + show_themes: opt.show_themes, side_by_side: opt.side_by_side, side_by_side_data, syntax_dummy_theme: SyntaxTheme::default(), -- cgit v1.2.3