mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
swapper: Make quotes optional in key-value regex
The regular expression describing the tmux user options expects to find quotes around the value. However, in at least tmux 3.0a the `show-options -g` command doesn't display quotes around the values, which means the regex fails. For example, the current regex will fail to find these user options: $ tmux -V tmux 3.0a $ tmux show -g | grep -E "@thumbs" @thumbs-bg-color default @thumbs-fg-color green @thumbs-hint-bg-color default @thumbs-hint-fg-color blue @thumbs-select-bg-color default @thumbs-select-fg-color green Make the quotes optional so that these options are picked up. Fixes #33
This commit is contained in:
parent
805a5ebe56
commit
e006b06ea0
@ -127,7 +127,7 @@ impl<'a> Swapper<'a> {
|
||||
let options = self.executor.execute(params);
|
||||
let lines: Vec<&str> = options.split('\n').collect();
|
||||
|
||||
let pattern = Regex::new(r#"@thumbs-([\w\-0-9]+) "(.*)""#).unwrap();
|
||||
let pattern = Regex::new(r#"@thumbs-([\w\-0-9]+) "?(\w+)"?"#).unwrap();
|
||||
|
||||
let args = lines
|
||||
.iter()
|
||||
|
Loading…
Reference in New Issue
Block a user