fix regexp parsing from tmux config

This commit is contained in:
Peter Bartyik 2020-09-03 13:06:10 +02:00
parent 3415117b6b
commit e53c48cc93

View File

@ -136,7 +136,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]+) "?(\w+)"?"#).unwrap();
let pattern = Regex::new(r#"@thumbs-([\w\-0-9]+)\s+(.+)"#).unwrap();
let args = lines
.iter()
@ -166,7 +166,7 @@ impl<'a> Swapper<'a> {
}
if name.starts_with("regexp") {
return vec!["--regexp".to_string(), format!("'{}'", value)];
return vec!["--regexp".to_string(), format!("'{}'", value.replace("\\\\", "\\"))];
}
vec![]