diff options
author | typebrook <typebrook@gmail.com> | 2020-04-10 13:10:50 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-04-10 13:10:50 +0800 |
commit | ae6c9de684fc1fbf3407483463de202ae6d630b4 (patch) | |
tree | 6a252ceac1547feafafa88c0ea2b287f93f237e0 | |
parent | 8a17ea850ca638b6a721a3fe1118cee3a186d73e (diff) |
Pin tags with regex pattern
-rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -252,7 +252,7 @@ _hashtags() { | |||
252 | 252 | ||
253 | _color_pinned_tags() { | 253 | _color_pinned_tags() { |
254 | local pinned_tags=( $pin ) | 254 | local pinned_tags=( $pin ) |
255 | pattern='('$(sed -E 's/ /[[:space:]]|/g; s/$/[[:space:]]/' <<<"${pinned_tags[@]/#/#}")')' | 255 | pattern='('$(sed -E 's/ /[[:space:]]|/g; s/\./[^ ]/g; s/$/[[:space:]]/' <<<"${pinned_tags[@]/#/#}")')' |
256 | sed -E -e "s/$pattern/\\\e[33m\1\\\e[0m/g" <<<"$1 " | 256 | sed -E -e "s/$pattern/\\\e[33m\1\\\e[0m/g" <<<"$1 " |
257 | } | 257 | } |
258 | 258 | ||