Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add execute_winapi on SetStyle to fix Windows compilation #690

Merged
merged 2 commits into from Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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