Optional colours in the global config file
[?]
Jan 13, 2021, 10:30 PM
5BB266P6HPUGYEVR7QNNOA62EFPYPUYJ3UMLE5J3LLYMSUWXANIQCDependencies
- [2]
SEWGHUHQ.pijul/config: simplify remotes and hooks - [3]
ZRUPLBBTColours in diff and change: separating concerns and dependencies - [4]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [5]
2K7JLB4ZNo pager on Windows - [6]
VIHXB7SGcommands: set up pager for diff, change, and credit - [7]
Q4SVMHAERemoving --channel from the changes command - [8]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [*]
SLJ3OHD4unrecord: show list of changes if none were given as arguments
Change contents
- edit in pijul/src/config.rs at line 11[10.822][4.90002]
pub colors: Option<Choice>,pub pager: Option<Choice>,}#[derive(Debug, Serialize, Deserialize)]pub enum Choice {#[serde(rename = "auto")]Auto,#[serde(rename = "always")]Always,#[serde(rename = "never")]Never, - edit in pijul/src/config.rs at line 75
pub colors: Option<Choice>,pub pager: Option<Choice>, - replacement in pijul/src/commands/diff.rs at line 90
let pager_is_colored = super::pager();let colors = is_colored(); - replacement in pijul/src/commands/diff.rs at line 163
colors: atty::is(atty::Stream::Stdout) || pager_is_colored,colors, - edit in pijul/src/commands/diff.rs at line 244
}}}pub fn is_colored() -> bool {let mut colors = atty::is(atty::Stream::Stdout);if let Ok(global) = crate::config::Global::load() {match global.colors {Some(crate::config::Choice::Always) => colors = true,Some(crate::config::Choice::Never) => colors = false,_ => {}}match global.pager {Some(crate::config::Choice::Never) => colors = false,_ => {super::pager();} - edit in pijul/src/commands/diff.rs at line 262
} else {colors |= super::pager(); - edit in pijul/src/commands/diff.rs at line 265
colors - replacement in pijul/src/commands/change.rs at line 44
let pager_is_colored = super::pager();let colors = super::diff::is_colored(); - replacement in pijul/src/commands/change.rs at line 52
colors: atty::is(atty::Stream::Stdout) || pager_is_colored,colors,