Skip to content

Commit

Permalink
support modifying tmux display-menu border style
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja-sonYun committed Feb 14, 2024
1 parent ab1309e commit 8e6ce6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# h: ...

title: " menu "
border: "simple"
items:

- NoDim:
Expand Down
4 changes: 4 additions & 0 deletions src/tmux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ impl Tmux {
spawn_binary(self.binary.clone(), arguments, non_block)
}

fn construct_border_arguments(border: &str) -> Vec<String> {
vec!["-b".to_string(), border.to_string()]
}

fn construct_position_arguments(position: &Position) -> Vec<String> {
if let (Some(w), Some(h)) = (position.w.clone(), position.h.clone()) {
vec![
Expand Down
1 change: 1 addition & 0 deletions src/tmux/subcommand/display_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl Tmux {
}
arguments.append(&mut Self::construct_title_arguments(&menu.title));
arguments.append(&mut Self::construct_position_arguments(&menu.position));
arguments.append(&mut Self::construct_border_arguments(&menu.border));
arguments.push("".to_string()); // We have to add seperator here before menu items
arguments.append(&mut Self::construct_menu_arguments(
&menu.items,
Expand Down
4 changes: 0 additions & 4 deletions src/tmux/subcommand/display_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ use anyhow::Result;
static DISPLAY_POPUP: &str = "display-popup";

impl Tmux {
fn construct_border_arguments(border: &str) -> Vec<String> {
vec!["-b".to_string(), border.to_string()]
}

pub fn display_popup(
&self,
command: String,
Expand Down

0 comments on commit 8e6ce6b

Please # to comment.