aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-05-13 16:39:25 +0800
committertypebrook <typebrook@gmail.com>2020-05-13 16:39:25 +0800
commit6f275d07f26175322489f31c7305b53080247c51 (patch)
tree3efe6e97d42632150c5b07d35bcf3d8666ebc356
parent080e3efecc1b76ab65b3732f08f1dfef9789a885 (diff)
Show status with description, do not override file_num and comment_num
-rwxr-xr-xgist12
1 files changed, 7 insertions, 5 deletions
diff --git a/gist b/gist
index 5938009..e25b18c 100755
--- a/gist
+++ b/gist
@@ -334,18 +334,20 @@ _show_list() {
334 if [[ $display == 'tag' ]]; then 334 if [[ $display == 'tag' ]]; then
335 local tags=( ${tags_string//,/ } ); message="${tags[@]}" 335 local tags=( ${tags_string//,/ } ); message="${tags[@]}"
336 [[ $show_untagged == 'false' && ${#tags[@]} == '0' ]] && continue 336 [[ $show_untagged == 'false' && ${#tags[@]} == '0' ]] && continue
337 local width=45; local align=' '; extra=''; 337 local width=45; local align=' ';
338 elif [[ $display == 'language' ]]; then 338 elif [[ $display == 'language' ]]; then
339 message="$(tr ',' '\n' <<< $file_array | sed -Ee 's/.+@/#/' | uniq | xargs)" 339 message="$(tr ',' '\n' <<< $file_array | sed -Ee 's/.+@/#/' | uniq | xargs)"
340 local width=45; local align=' '; extra=''; 340 local width=45; local align=' ';
341 fi 341 fi
342 342
343 local extra=$(_check_repo_status "$folder/${url##*/}" "$blob_code") 343 local status=''
344 [[ -z $extra ]] && extra="$(printf "%-4s" "$file_num $comment_num")" 344 status=$(_check_repo_status "$folder/${url##*/}" "$blob_code")
345 status="${status:+${status} }"
346 local extra="$(printf "%-4s" "$file_num $comment_num")"
345 347
346 [[ $index =~ ^s ]] && description="$(printf "%-12s" [${author}]) ${description}" 348 [[ $index =~ ^s ]] && description="$(printf "%-12s" [${author}]) ${description}"
347 349
348 raw_output="$(printf "%-3s" "$index") $(printf "%${align:--}${width:-56}s" "$message") $extra $(_color_description_title "$description")" 350 raw_output="$(printf "%-3s" "$index") $(printf "%${align:--}${width:-56}s" "$message") $extra $status$(_color_description_title "$description")"
349 [[ -n $pin ]] && raw_output="$(_color_pinned_tags "$raw_output")" 351 [[ -n $pin ]] && raw_output="$(_color_pinned_tags "$raw_output")"
350 decorator=$(( $(grep -o '\\e\[0m' <<<"$raw_output" | wc -l) *9 )) 352 decorator=$(( $(grep -o '\\e\[0m' <<<"$raw_output" | wc -l) *9 ))
351 echo -e "$raw_output" | cut -c -$(( $(tput cols) +decorator )) 353 echo -e "$raw_output" | cut -c -$(( $(tput cols) +decorator ))