-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue where pager would be set to more
or most
#1494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks very much! I've made a couple of small requests for changes to the diff.
src/env.rs
Outdated
@@ -41,7 +41,11 @@ impl DeltaEnv { | |||
let pagers = ( | |||
env::var(DELTA_PAGER).ok(), | |||
env::var(BAT_PAGER).ok(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind getting rid of all explicit mention of BAT_PAGER
. get_pager_executable
will look at BAT_PAGER
itself.
src/env.rs
Outdated
@@ -10,7 +10,7 @@ const DELTA_EXPERIMENTAL_MAX_LINE_DISTANCE_FOR_NAIVELY_PAIRED_LINES: &str = | |||
"DELTA_EXPERIMENTAL_MAX_LINE_DISTANCE_FOR_NAIVELY_PAIRED_LINES"; | |||
const DELTA_PAGER: &str = "DELTA_PAGER"; | |||
const BAT_PAGER: &str = "BAT_PAGER"; | |||
const PAGER: &str = "PAGER"; | |||
// const PAGER: &str = "PAGER"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove this commented line please.
src/env.rs
Outdated
@@ -41,7 +41,11 @@ impl DeltaEnv { | |||
let pagers = ( | |||
env::var(DELTA_PAGER).ok(), | |||
env::var(BAT_PAGER).ok(), | |||
env::var(PAGER).ok(), | |||
// We're using `bar::config::get_pager_executable` here instead of just returning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// We're using `bar::config::get_pager_executable` here instead of just returning | |
// We're using `bat::config::get_pager_executable` here instead of just returning |
@dandavison all fixed ! that's true now that i reread the source code of bat, no need for handling |
Perfect, thanks for doing this! |
You're welcome ! it was a fun thing to do ! and thanks for making such a useful app ! |
Bug
Colors wouldn't render properly in case the
$PAGER
is set tomore
ormost
.(fix for #1490 )Solution
Handle the case where
$PAGER
is set tomore
ormost
by usingbat::config::get_pager_executable
which sets the pager toless
if that's the case.Unit tests: