mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
Match @ in paths
This commit is contained in:
parent
fcb6c60151
commit
2ac8bc25ca
@ -20,6 +20,8 @@ ipsum [fcsonline](https://github.com/fcsonline) lorem
|
|||||||
|
|
||||||
path: /var/log/nginx.log[m
|
path: /var/log/nginx.log[m
|
||||||
|
|
||||||
|
path: ./folder/.neomake@04fd.log
|
||||||
|
|
||||||
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
||||||
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
||||||
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
10.3.23.42 lorem 123.2.3.4 lorem 230.23.33.34
|
||||||
|
11
src/state.rs
11
src/state.rs
@ -13,7 +13,7 @@ const PATTERNS: [(&'static str, &'static str); 12] = [
|
|||||||
),
|
),
|
||||||
("diff_a", r"--- a/([^ ]+)"),
|
("diff_a", r"--- a/([^ ]+)"),
|
||||||
("diff_b", r"\+\+\+ b/([^ ]+)"),
|
("diff_b", r"\+\+\+ b/([^ ]+)"),
|
||||||
("path", r"(([.\w-]+)?(/[.\w-]+)+)"),
|
("path", r"(([.\w\-@]+)?(/[.\w\-@]+)+)"),
|
||||||
("color", r"#[0-9a-fA-F]{6}"),
|
("color", r"#[0-9a-fA-F]{6}"),
|
||||||
(
|
(
|
||||||
"uid",
|
"uid",
|
||||||
@ -210,13 +210,14 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn match_bash() {
|
fn match_bash() {
|
||||||
let lines = split("path: [32m/var/log/nginx.log[m\npath: [32mtest/log/nginx.log:32[m");
|
let lines = split("path: [32m/var/log/nginx.log[m\npath: [32mtest/log/nginx-2.log:32[mfolder/.nginx@4df2.log");
|
||||||
let custom = [].to_vec();
|
let custom = [].to_vec();
|
||||||
let results = State::new(&lines, "abcd", &custom).matches(false, false);
|
let results = State::new(&lines, "abcd", &custom).matches(false, false);
|
||||||
|
|
||||||
assert_eq!(results.len(), 2);
|
assert_eq!(results.len(), 3);
|
||||||
assert_eq!(results.first().unwrap().text, "/var/log/nginx.log");
|
assert_eq!(results.get(0).unwrap().text, "/var/log/nginx.log");
|
||||||
assert_eq!(results.last().unwrap().text, "test/log/nginx.log");
|
assert_eq!(results.get(1).unwrap().text, "test/log/nginx-2.log");
|
||||||
|
assert_eq!(results.get(2).unwrap().text, "folder/.nginx@4df2.log");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user