Fix issue where pager would be set to more or most#1494
Merged
dandavison merged 4 commits intodandavison:masterfrom Jul 29, 2023
Merged
Fix issue where pager would be set to more or most#1494dandavison merged 4 commits intodandavison:masterfrom
more or most#1494dandavison merged 4 commits intodandavison:masterfrom
Conversation
dandavison
requested changes
Jul 29, 2023
Owner
dandavison
left a comment
There was a problem hiding this comment.
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(), | |||
Owner
There was a problem hiding this comment.
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
| const DELTA_PAGER: &str = "DELTA_PAGER"; | ||
| const BAT_PAGER: &str = "BAT_PAGER"; | ||
| const PAGER: &str = "PAGER"; | ||
| // const PAGER: &str = "PAGER"; |
Owner
There was a problem hiding this comment.
Could you remove this commented line please.
src/env.rs
Outdated
| 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 |
Owner
There was a problem hiding this comment.
Suggested change
| // 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 |
Contributor
Author
|
@dandavison all fixed ! that's true now that i reread the source code of bat, no need for handling |
Owner
|
Perfect, thanks for doing this! |
Contributor
Author
|
You're welcome ! it was a fun thing to do ! and thanks for making such a useful app ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Colors wouldn't render properly in case the

$PAGERis set tomoreormost.(fix for #1490 )Solution
Handle the case where
$PAGERis set tomoreormostby usingbat::config::get_pager_executablewhich sets the pager tolessif that's the case.Unit tests: