diff options
| -rwxr-xr-x | gist | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -62,8 +62,12 @@ CONFIG=~/.config/gist.conf; mkdir -p ~/.config | |||
| 62 | 62 | ||
| 63 | INDEX_FORMAT=('index' 'url' 'tags_string' 'blob_code' 'file_array' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') | 63 | INDEX_FORMAT=('index' 'url' 'tags_string' 'blob_code' 'file_array' 'file_num' 'comment_num' 'author' 'created_at' 'updated_at' 'description') |
| 64 | TAG_CHAR='-_[:alnum:]' | 64 | TAG_CHAR='-_[:alnum:]' |
| 65 | [[ ! -t 0 ]] && INPUT=$(cat) | 65 | if [[ ! -t 0 ]]; then |
| 66 | export mark=[^s] # By defaut, only process user's gists, not starred gist | 66 | INPUT=$(cat) |
| 67 | export mark=. | ||
| 68 | else | ||
| 69 | export mark=[^s] # By defaut, only process user's gists, not starred gist | ||
| 70 | fi | ||
| 67 | 71 | ||
| 68 | # Default configuration | 72 | # Default configuration |
| 69 | [[ ! -t 1 && -z $hint ]] && hint=false | 73 | [[ ! -t 1 && -z $hint ]] && hint=false |
| @@ -827,7 +831,7 @@ _pin_tags() { | |||
| 827 | # show languages of files in gists | 831 | # show languages of files in gists |
| 828 | _gists_with_languages() { | 832 | _gists_with_languages() { |
| 829 | local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /|/g' <<<"$@"))" | 833 | local pattern="($(sed -E 's/([^ ]+)/#\1/g; s/ /|/g' <<<"$@"))" |
| 830 | hint=false mark=${INPUT:+.} display=language _show_list | grep --color=always -Ei "$pattern" | 834 | hint=false display=language _show_list | grep --color=always -Ei "$pattern" |
| 831 | } | 835 | } |
| 832 | 836 | ||
| 833 | _gists_with_range() { | 837 | _gists_with_range() { |