From c90b5f67e5bb65afebae1c8e67cf6e284ca97254 Mon Sep 17 00:00:00 2001 From: Mattias Eriksson Date: Mon, 22 Jan 2024 08:10:57 +0100 Subject: [PATCH] Remove conditional compilation --- src/key_bind.rs | 1 - src/main.rs | 22 ++++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/key_bind.rs b/src/key_bind.rs index 03b9b1f..bf54cad 100644 --- a/src/key_bind.rs +++ b/src/key_bind.rs @@ -61,7 +61,6 @@ pub fn key_binds() -> HashMap { bind!([Ctrl, Shift], Q, WindowClose); bind!([Ctrl, Shift], T, TabNew); bind!([Ctrl, Shift], V, Paste); - #[cfg(target_family = "unix")] bind!([Shift], Insert, PastePrimary); bind!([Ctrl, Shift], W, TabClose); diff --git a/src/main.rs b/src/main.rs index 43d1734..02edb54 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,7 +166,6 @@ pub struct Flags { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { Copy, - #[cfg(target_family = "unix")] CopyPrimary, Find, PaneFocusDown, @@ -177,7 +176,6 @@ pub enum Action { PaneSplitVertical, PaneToggleMaximized, Paste, - #[cfg(target_family = "unix")] PastePrimary, SelectAll, Settings, @@ -206,7 +204,6 @@ impl Action { pub fn message(self, entity_opt: Option) -> Message { match self { Action::Copy => Message::Copy(entity_opt), - #[cfg(target_family = "unix")] Action::CopyPrimary => Message::CopyPrimary(entity_opt), Action::Find => Message::Find(true), Action::PaneFocusDown => Message::PaneFocusAdjacent(pane_grid::Direction::Down), @@ -217,7 +214,6 @@ impl Action { Action::PaneSplitVertical => Message::PaneSplit(pane_grid::Axis::Vertical), Action::PaneToggleMaximized => Message::PaneToggleMaximized, Action::Paste => Message::Paste(entity_opt), - #[cfg(target_family = "unix")] Action::PastePrimary => Message::PastePrimary(entity_opt), Action::SelectAll => Message::SelectAll(entity_opt), Action::Settings => Message::ToggleContextPage(ContextPage::Settings), @@ -263,7 +259,6 @@ pub enum Message { FindNext, FindPrevious, FindSearchValueChanged(String), - #[cfg(target_family = "unix")] MiddleClick(pane_grid::Pane, Option), PaneClicked(pane_grid::Pane), PaneSplit(pane_grid::Axis), @@ -273,7 +268,6 @@ pub enum Message { PaneResized(pane_grid::ResizeEvent), Modifiers(Modifiers), Paste(Option), - #[cfg(target_family = "unix")] PastePrimary(Option), PasteValue(Option, String), SelectAll(Option), @@ -1072,7 +1066,6 @@ impl Application for App { Message::FindSearchValueChanged(value) => { self.find_search_value = value; } - #[cfg(target_family = "unix")] Message::MiddleClick(pane, entity_opt) => { self.pane_model.focus = pane; return Command::batch([ @@ -1134,7 +1127,6 @@ impl Application for App { None => message::none(), }); } - #[cfg(target_family = "unix")] Message::PastePrimary(entity_opt) => { return clipboard::read_primary(move |value_opt| match value_opt { Some(value) => message::app(Message::PasteValue(entity_opt, value)), @@ -1450,16 +1442,14 @@ impl Application for App { .unwrap_or_else(widget::Id::unique); match tab_model.data::>(entity) { Some(terminal) => { - let mut terminal_box = terminal_box(terminal).id(terminal_id).on_context_menu( - move |position_opt| Message::TabContextMenu(entity, position_opt), - ); - - #[cfg(target_family = "unix")] - { - terminal_box = terminal_box.on_middle_click(move || { + let terminal_box = terminal_box(terminal) + .id(terminal_id) + .on_context_menu(move |position_opt| { + Message::TabContextMenu(entity, position_opt) + }) + .on_middle_click(move || { Message::MiddleClick(pane, Some(entity_middle_click)) }); - } let context_menu = { let terminal = terminal.lock().unwrap();