fix(keybinds): add 'floating' and 'name' to the Run command keybinding (#2726)
* fix(keybinds): add 'floating' and 'name' to the Run command keybinding * style(fmt): rustfmt
This commit is contained in:
parent
e34f7e7622
commit
a537e09bb7
1 changed files with 15 additions and 1 deletions
|
|
@ -870,6 +870,9 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
|
||||||
let cwd = command_metadata
|
let cwd = command_metadata
|
||||||
.and_then(|c_m| kdl_child_string_value_for_entry(c_m, "cwd"))
|
.and_then(|c_m| kdl_child_string_value_for_entry(c_m, "cwd"))
|
||||||
.map(|cwd_string| PathBuf::from(cwd_string));
|
.map(|cwd_string| PathBuf::from(cwd_string));
|
||||||
|
let name = command_metadata
|
||||||
|
.and_then(|c_m| kdl_child_string_value_for_entry(c_m, "name"))
|
||||||
|
.map(|name_string| name_string.to_string());
|
||||||
let direction = command_metadata
|
let direction = command_metadata
|
||||||
.and_then(|c_m| kdl_child_string_value_for_entry(c_m, "direction"))
|
.and_then(|c_m| kdl_child_string_value_for_entry(c_m, "direction"))
|
||||||
.and_then(|direction_string| Direction::from_str(direction_string).ok());
|
.and_then(|direction_string| Direction::from_str(direction_string).ok());
|
||||||
|
|
@ -880,6 +883,9 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
|
||||||
let hold_on_start = command_metadata
|
let hold_on_start = command_metadata
|
||||||
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "start_suspended"))
|
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "start_suspended"))
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
let floating = command_metadata
|
||||||
|
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "floating"))
|
||||||
|
.unwrap_or(false);
|
||||||
let run_command_action = RunCommandAction {
|
let run_command_action = RunCommandAction {
|
||||||
command: PathBuf::from(command),
|
command: PathBuf::from(command),
|
||||||
args,
|
args,
|
||||||
|
|
@ -888,7 +894,15 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
|
||||||
hold_on_close,
|
hold_on_close,
|
||||||
hold_on_start,
|
hold_on_start,
|
||||||
};
|
};
|
||||||
Ok(Action::Run(run_command_action))
|
if floating {
|
||||||
|
Ok(Action::NewFloatingPane(Some(run_command_action), name))
|
||||||
|
} else {
|
||||||
|
Ok(Action::NewTiledPane(
|
||||||
|
direction,
|
||||||
|
Some(run_command_action),
|
||||||
|
name,
|
||||||
|
))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"LaunchOrFocusPlugin" => {
|
"LaunchOrFocusPlugin" => {
|
||||||
let arguments = action_arguments.iter().copied();
|
let arguments = action_arguments.iter().copied();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue