mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
Fix path with ~
This commit is contained in:
parent
122c26b8b0
commit
53af67e6fa
@ -22,6 +22,8 @@ path: /var/log/nginx.log[m
|
||||
|
||||
path: ./folder/.neomake@04fd.log
|
||||
|
||||
home: ~/.gnu/.config.txt
|
||||
|
||||
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
|
||||
|
12
src/state.rs
12
src/state.rs
@ -9,7 +9,7 @@ const PATTERNS: [(&'static str, &'static str); 13] = [
|
||||
("url", r"((https?://|git@|git://|ssh://|ftp://|file:///)[^ ]+)"),
|
||||
("diff_a", r"--- a/([^ ]+)"),
|
||||
("diff_b", r"\+\+\+ b/([^ ]+)"),
|
||||
("path", r"(([.\w\-@]+)?(/[.\w\-@]+)+)"),
|
||||
("path", r"(([.\w\-@~]+)?(/[.\w\-@]+)+)"),
|
||||
("color", r"#[0-9a-fA-F]{6}"),
|
||||
("uid", r"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"),
|
||||
("ipfs", r"Qm[0-9a-zA-Z]{44}"),
|
||||
@ -224,6 +224,16 @@ mod tests {
|
||||
assert_eq!(results.get(2).unwrap().text.clone(), "../log/kern.log");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_home() {
|
||||
let lines = split("Lorem ~/.gnu/.config.txt, lorem");
|
||||
let custom = [].to_vec();
|
||||
let results = State::new(&lines, "abcd", &custom).matches(false, false);
|
||||
|
||||
assert_eq!(results.len(), 1);
|
||||
assert_eq!(results.get(0).unwrap().text.clone(), "~/.gnu/.config.txt");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_uids() {
|
||||
let lines = split("Lorem ipsum 123e4567-e89b-12d3-a456-426655440000 lorem\n Lorem lorem lorem");
|
||||
|
Loading…
Reference in New Issue
Block a user