Skip to content

Commit

Permalink
Fix matching URLs inside quotes and bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Lopes committed Dec 25, 2018
1 parent be123ba commit 3aa39e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion copycat.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set_default_stored_searches() {
local ip_search="$(get_tmux_option "$copycat_ip_search_option" "$default_ip_search_key")"

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

0 comments on commit 3aa39e8

Please sign in to comment.