diff options
author | Catherine Noll <noll.catherine@gmail.com> | 2021-03-21 12:50:45 -0500 |
---|---|---|
committer | Catherine Noll <noll.catherine@gmail.com> | 2021-03-21 12:50:45 -0500 |
commit | 85f591b75297c085ba321e869b1d3a63a0d4837d (patch) | |
tree | b3a7f19a4f5669657698afb0f4741f47cfeed8ed | |
parent | 3572ec451f78270fc5aa8348e6ac716a32ab366c (diff) |
Send navigation command to less on --show-themes
-rw-r--r-- | src/bat_utils/output.rs | 3 | ||||
-rw-r--r-- | src/config.rs | 2 |
2 files changed, 5 insertions, 0 deletions
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<cli::Opt> 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(), |