Skip to content

Commit 3aa39e8

Browse files
author
Francisco Lopes
committed
Fix matching URLs inside quotes and bracket
1 parent be123ba commit 3aa39e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

copycat.tmux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set_default_stored_searches() {
1515
local ip_search="$(get_tmux_option "$copycat_ip_search_option" "$default_ip_search_key")"
1616

1717
if stored_search_not_defined "$url_search"; then
18-
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${url_search}" "(https?://|git@|git://|ssh://|ftp://|file:///)[\x22\x27[:alnum:]?=%/_.:,;~@!#$&()*+-]*"
18+
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${url_search}" "(?<=\(|([\x22\x27]))((https?://|git@|git://|ssh://|ftp://|file:///)[\x22\x27[:alnum:]?=%/_.:,;~@!#$&()*+-]*)(?=\)|\1)|(?2)"
1919
fi
2020
if stored_search_not_defined "$file_search"; then
2121
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${file_search}" "(^|(?<=[[:space:]]))(\.|\.\.)?[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*"

0 commit comments

Comments
 (0)