Skip to content

Commit

Permalink
Add execute_winapi on SetStyle to fix Windows compilation (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
groves committed Jul 26, 2022
1 parent 60e51be commit c6a8952
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/event.rs
Expand Up @@ -74,6 +74,7 @@

use std::fmt;
use std::hash::{Hash, Hasher};
use std::io;
use std::time::Duration;

use bitflags::bitflags;
Expand Down
10 changes: 10 additions & 0 deletions src/style.rs
Expand Up @@ -366,6 +366,16 @@ impl Command for SetStyle {

Ok(())
}

#[cfg(windows)]
fn execute_winapi(&self) -> Result<()> {
panic!("tried to execute SetStyle command using WinAPI, use ANSI instead");
}

#[cfg(windows)]
fn is_ansi_code_supported(&self) -> bool {
true
}
}

/// A command that prints styled content.
Expand Down

0 comments on commit c6a8952

Please sign in to comment.