From c6a895220124f2eaac18872347cdaa1ef0fcb1ad Mon Sep 17 00:00:00 2001 From: Charlie Groves Date: Tue, 26 Jul 2022 10:01:16 -0400 Subject: [PATCH] Add execute_winapi on SetStyle to fix Windows compilation (#690) --- src/event.rs | 1 + src/style.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/event.rs b/src/event.rs index d3152b45a..accc19c1d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -74,6 +74,7 @@ use std::fmt; use std::hash::{Hash, Hasher}; +use std::io; use std::time::Duration; use bitflags::bitflags; diff --git a/src/style.rs b/src/style.rs index c54315885..f4cd55433 100644 --- a/src/style.rs +++ b/src/style.rs @@ -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.