use crate::options::pane::common::constants::*;
use crate::{RemainOnExit, SetOptionTr, SetUserOption, Switch, TmuxCommand};
use std::borrow::Cow;
pub trait SetPaneOptionTr: SetOptionTr + SetUserOption {
#[cfg(feature = "tmux_3_0")]
fn allow_rename<'a, S>(target: Option<S>, switch: Option<Switch>) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
{
Self::set_ext(target, ALLOW_RENAME, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_3_0")]
fn alternate_screen<'a, S>(target: Option<S>, switch: Option<Switch>) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
{
Self::set_ext(target, ALTERNATE_SCREEN, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_3_0")]
fn remain_on_exit<'a, S>(
target: Option<S>,
remain_on_exit: Option<RemainOnExit>,
) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
{
Self::set_ext(
target,
REMAIN_ON_EXIT,
remain_on_exit.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_3_0")]
fn window_active_style<'a, S, T>(target: Option<S>, style: Option<T>) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
T: Into<Cow<'a, str>>,
{
Self::set_ext(target, WINDOW_ACTIVE_STYLE, style)
}
#[cfg(feature = "tmux_3_0")]
fn window_style<'a, S, T>(target: Option<S>, style: Option<T>) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
T: Into<Cow<'a, str>>,
{
Self::set_ext(target, WINDOW_STYLE, style)
}
#[cfg(feature = "tmux_3_2")]
fn synchronize_panes<'a, S>(target: Option<S>, switch: Option<Switch>) -> TmuxCommand<'a>
where
S: Into<Cow<'a, str>>,
{
Self::set_ext(target, SYNCHRONIZE_PANES, switch.map(|s| s.to_string()))
}
}