diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-27 17:33:58 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-27 17:33:59 +0800 |
| commit | 0de701d8e545393b4ce818cb703010f9ae2ec27b (patch) | |
| tree | 81abf2c106754a9471bdad75cc9f55fd7c17215d | |
| parent | 4725f3ed63f010dcd4171eebd3f754ab2feacf54 (diff) | |
Fix logic error in 'gist grep'
Remove content greping for hashtags inside original description
| -rwxr-xr-x | gist | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -325,7 +325,8 @@ _grep_content() { | |||
| 325 | sed -Ee "/^$(_index_pattern) / !d" $INDEX \ | 325 | sed -Ee "/^$(_index_pattern) / !d" $INDEX \ |
| 326 | | while read -r "${INDEX_FORMAT[@]}"; do | 326 | | while read -r "${INDEX_FORMAT[@]}"; do |
| 327 | # grep from description | 327 | # grep from description |
| 328 | if grep --color=always -iq "$1" <<<"$description"; then | 328 | local hashtags="$(_hashtags "$description")" |
| 329 | if grep --color=always -iq "$1" <<<"${description%% $hashtags}"; then | ||
| 329 | hint=false mark="$index " _show_list | grep --color=always -Ei "$1" | 330 | hint=false mark="$index " _show_list | grep --color=always -Ei "$1" |
| 330 | else | 331 | else |
| 331 | local repo=$folder/${url##*/} | 332 | local repo=$folder/${url##*/} |