Commit Graph

9 Commits

Author SHA1 Message Date
Martin Nordholts dc1620d1f0 get_pager(): Simplify use_less_instead expression 2021-01-11 21:56:10 +01:00
Martin Nordholts dd0d44bbb3 Fix #1413 Can't use `bat` at all! (Error: Use of bat as a pager is disallowed...)
Fixed by implementing the proposal by sharkdp:

* Allow PAGER=bat, but ignore the setting in bat and simply default to
  less. Unless of course, BAT_PAGER or --pager is used to overwrite the
  value of PAGER.

* Disallow the usage of bat within BAT_PAGER and --pager.
2021-01-11 21:56:10 +01:00
Martin Nordholts 7809008016 PagerKind::from(): Simplify 2021-01-10 13:40:07 +01:00
Martin Nordholts dd6f57e107 pager.rs: Some comment fixups 2021-01-10 13:25:18 +01:00
Martin Nordholts dfe7a60140 PagerSource: [Bat]PagerEnvVar -> EnvVar[Bat]Pager 2021-01-10 13:16:09 +01:00
Martin Nordholts fc30277cfa pager.rs: Limit visibilities to pub(crate) 2021-01-10 13:07:37 +01:00
Martin Nordholts bfa5342331 Also replace 'more' from PAGER with 'less'
But first do some quite significant refactorings to keep the code clean
and easy to understand.
2020-12-30 17:59:30 +01:00
Martin Nordholts dcfe883f4b Simplify and polish pager.rs and related code 2020-12-28 22:39:34 +01:00
Martin Nordholts f4202361b4 Add Pager helper with info about where the value comes from
In preparation of fixing issue #1063.
This is a pure refactoring with no intended functional side effects.
2020-11-27 06:42:58 +01:00