Add execute_winapi on SetStyle to fix Windows compilation (#690)

This commit is contained in:
Charlie Groves 2022-07-26 10:01:16 -04:00 committed by GitHub
parent 60e51be726
commit c6a8952201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -74,6 +74,7 @@
use std::fmt;
use std::hash::{Hash, Hasher};
use std::io;
use std::time::Duration;
use bitflags::bitflags;

View File

@ -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.