1
0
Fork 0
forked from wry/wry

config: fix toml move-to-workspace action

This commit is contained in:
Julian Orth 2024-03-17 09:43:31 +01:00
parent c921e2400e
commit 2a517f437a
3 changed files with 6 additions and 1 deletions

View file

@ -60,6 +60,7 @@ pub enum Action {
ConfigureInput { input: Input },
ConfigureOutput { out: Output },
Exec { exec: Exec },
MoveToWorkspace { name: String },
Multi { actions: Vec<Action> },
SetEnv { env: Vec<(String, String)> },
SetGfxApi { api: GfxApi },

View file

@ -133,7 +133,7 @@ impl ActionParser<'_> {
fn parse_move_to_workspace(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
let name = ext.extract(str("name"))?.value.to_string();
Ok(Action::ShowWorkspace { name })
Ok(Action::MoveToWorkspace { name })
}
fn parse_configure_connector(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {

View file

@ -75,6 +75,10 @@ impl Action {
let workspace = get_workspace(&name);
Box::new(move || s.show_workspace(workspace))
}
Action::MoveToWorkspace { name } => {
let workspace = get_workspace(&name);
Box::new(move || s.set_workspace(workspace))
}
Action::ConfigureConnector { con } => Box::new(move || {
for c in connectors() {
if con.match_.matches(c) {