Commit Graph

12 Commits (master)

Author SHA1 Message Date
John Higgins 7b2e0ece55
Prevent fork nightmare with PAGER=batcat (#2235)
* Added rsamuelklatchko's changes

* Added some comments and deleted redundant code

* Ran cargo fmt

* Update src/pager.rs

Co-authored-by: Martin Nordholts <enselic@gmail.com>

* Added bugfix to changelog

* src/pager.rs nitpick: arg0 -> s

I forgot to comment on this name so I figured I'd just push a commit to
take care of it.

Co-authored-by: Martin Nordholts <enselic@gmail.com>
2 years ago
Mohamed Abdelnour aa74d19940 Refactor "Use `matches` macro" 3 years ago
Mohamed Abdelnour 23fd11e806 Use `matches` macro 3 years ago
Martin Nordholts dc1620d1f0 get_pager(): Simplify use_less_instead expression 3 years ago
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.
3 years ago
Martin Nordholts 7809008016 PagerKind::from(): Simplify 3 years ago
Martin Nordholts dd6f57e107 pager.rs: Some comment fixups 3 years ago
Martin Nordholts dfe7a60140 PagerSource: [Bat]PagerEnvVar -> EnvVar[Bat]Pager 3 years ago
Martin Nordholts fc30277cfa pager.rs: Limit visibilities to pub(crate) 3 years ago
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.
3 years ago
Martin Nordholts dcfe883f4b Simplify and polish pager.rs and related code 3 years ago
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.
4 years ago