diff options
-rwxr-xr-x | gist | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -284,9 +284,9 @@ _show_list() { | |||
284 | [[ $index =~ ^s ]] && extra=$(printf "%-12s" $author)${extra} | 284 | [[ $index =~ ^s ]] && extra=$(printf "%-12s" $author)${extra} |
285 | local hashtags=$(_hashtags "$description") | 285 | local hashtags=$(_hashtags "$description") |
286 | local description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") | 286 | local description=$(sed -E -e 's/^\[(.+)\]/\\e[33m[\1]\\e[0m/' <<<"$description" | sed "s/ $hashtags$//") |
287 | [[ $tag == 'true' ]] && url="$hashtags" && local width=45 | 287 | [[ $tag == 'true' ]] && url="$hashtags" && local width=45 && align=' ' |
288 | 288 | ||
289 | raw_output="$(printf "% 3s" "$index") $(printf "%-${width:-56}s" "$url") $extra $description" | 289 | raw_output="$(printf "% 3s" "$index") $(printf "%${align:--}${width:-56}s" "$url") $extra $description" |
290 | decorator=$(( $(grep -o '\\e\[0m' <<<"$raw_output" | wc -l) *9 )) | 290 | decorator=$(( $(grep -o '\\e\[0m' <<<"$raw_output" | wc -l) *9 )) |
291 | echo -e "$raw_output" | cut -c -$(( $(tput cols) +decorator )) | 291 | echo -e "$raw_output" | cut -c -$(( $(tput cols) +decorator )) |
292 | done | 292 | done |
@@ -667,7 +667,7 @@ _tag_gist() { | |||
667 | # if user want to filter gists with given tags | 667 | # if user want to filter gists with given tags |
668 | elif [[ -n $1 ]]; then | 668 | elif [[ -n $1 ]]; then |
669 | local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /|/g' <<<"$@"))" | 669 | local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /|/g' <<<"$@"))" |
670 | sed -En "/$pattern/ p" $INDEX | hint=false _show_list - | 670 | sed -En "/$pattern/ p" $INDEX | hint=false tag=true _show_list - |
671 | else | 671 | else |
672 | tag=true _show_list | 672 | tag=true _show_list |
673 | fi | 673 | fi |