diff options
author | Benjamin Nguyen <benjamin.van.nguyen@gmail.com> | 2023-06-25 23:35:38 -0700 |
---|---|---|
committer | Benjamin Nguyen <benjamin.van.nguyen@gmail.com> | 2023-06-25 23:35:38 -0700 |
commit | 907a6e31d64d2010d987cd8f743e6add047f8592 (patch) | |
tree | d1d13316a1ee4f55c2a1440d5da52ad0968f1850 | |
parent | 910d9d3cbbac1d2dbe596c647b16e1f658ac3c9f (diff) |
no color support
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/context/mod.rs | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -773,6 +773,8 @@ If, however, the default behavior doesn't suit your needs you have control over - force: Turn on colorization always ``` +`erdtree` also supports [NO_COLOR](https://no-color.org/). + <p align="center"> <img src="https://github.com/solidiquis/erdtree/blob/master/assets/colorization.png?raw=true" alt="failed to load picture" /> </p> diff --git a/src/context/mod.rs b/src/context/mod.rs index 9d331d7..c7e060a 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -327,8 +327,8 @@ impl Context { /// /// If Coloring is Force then this will always evaluate to `false`. pub fn no_color(&self) -> bool { - if color::NO_COLOR.get().is_some_and(Option::is_some) { - return true; + if let Some(Some(var)) = color::NO_COLOR.get() { + return !var.is_empty(); } match self.color { |