refactor: change canvas macOS check to compile-time (#1184)
This commit is contained in:
parent
c6d322263e
commit
5e0900584b
|
@ -63,7 +63,6 @@ pub struct Painter {
|
|||
height: u16,
|
||||
width: u16,
|
||||
styled_help_text: Vec<Line<'static>>,
|
||||
is_mac_os: bool, // TODO: This feels out of place...
|
||||
|
||||
// TODO: Redo this entire thing.
|
||||
row_constraints: Vec<LayoutConstraint>,
|
||||
|
@ -157,7 +156,6 @@ impl Painter {
|
|||
height: 0,
|
||||
width: 0,
|
||||
styled_help_text: Vec::default(),
|
||||
is_mac_os: cfg!(target_os = "macos"),
|
||||
row_constraints,
|
||||
col_constraints,
|
||||
col_row_constraints,
|
||||
|
|
|
@ -220,10 +220,14 @@ impl Painter {
|
|||
|
||||
// TODO: [MOUSE] Mouse support for these in search
|
||||
// TODO: [MOVEMENT] Movement support for these in search
|
||||
let (case, whole, regex) = if self.is_mac_os {
|
||||
("Case(F1)", "Whole(F2)", "Regex(F3)")
|
||||
} else {
|
||||
("Case(Alt+C)", "Whole(Alt+W)", "Regex(Alt+R)")
|
||||
let (case, whole, regex) = {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(target_os = "macos")] {
|
||||
("Case(F1)", "Whole(F2)", "Regex(F3)")
|
||||
} else {
|
||||
("Case(Alt+C)", "Whole(Alt+W)", "Regex(Alt+R)")
|
||||
}
|
||||
}
|
||||
};
|
||||
let option_text = Line::from(vec![
|
||||
Span::styled(case, case_style),
|
||||
|
|
Loading…
Reference in New Issue