Skip to content

Commit

Permalink
Merge branch 'terminal-light-mio'
Browse files Browse the repository at this point in the history
  • Loading branch information
Canop committed Jul 11, 2022
2 parents 94ef5f6 + f5b33c4 commit db41705
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ syntect = { package = "syntect-no-panic", version = "4.6.1" } # see issue #485
tempfile = "3.2"
termimad = "0.20.2"
terminal-clipboard = { version = "0.3.1", optional = true }
terminal-light = { version = "0.8.1", git = "https://github.com/Canop/terminal-light", branch = "mio" }
toml = "0.5"
umask = "2.0.0"
unicode-width = "0.1.8"
Expand All @@ -71,9 +72,6 @@ glassbench = "0.3.3"
lfs-core = "0.11.0"
users = "0.11"

[target.'cfg(target_os = "linux")'.dependencies]
terminal-light = "0.8.1"

[target.'cfg(windows)'.dependencies]
is_executable = "1.0.1"

Expand Down Expand Up @@ -118,5 +116,6 @@ harness = false
# syntect = { path = "../syntect" }
# syntect-no-panic = { path = "../syntect" }
# termimad = { path = "../termimad" }
# terminal-light = { path = "../terminal-light" }
# terminal-clipboard = { path = "../terminal-clipboard" }
# umask = { path = "../umask" }
6 changes: 0 additions & 6 deletions src/display/luma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub enum Luma {

/// Return the light of the terminal background, which is a value
/// between 0 (black) and 1 (white).
#[cfg(target_os = "linux")]
pub fn luma() -> &'static Result<f32, terminal_light::TlError> {
static LUMA: Lazy<Result<f32, terminal_light::TlError>> = Lazy::new(|| {
let luma = time!(Debug, terminal_light::luma());
Expand All @@ -25,11 +24,6 @@ pub fn luma() -> &'static Result<f32, terminal_light::TlError> {
&*LUMA
}

#[cfg(not(target_os = "linux"))]
pub fn luma() -> Result<&'static f32, &'static str> {
Err("not implemented on this OS")
}

impl Luma {
pub fn read() -> Self {
match luma() {
Expand Down

0 comments on commit db41705

Please sign in to comment.