From 0de701d8e545393b4ce818cb703010f9ae2ec27b Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 27 Mar 2020 17:33:58 +0800 Subject: Fix logic error in 'gist grep' Remove content greping for hashtags inside original description --- gist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gist b/gist index 6c65868..3805f09 100755 --- a/gist +++ b/gist @@ -325,7 +325,8 @@ _grep_content() { sed -Ee "/^$(_index_pattern) / !d" $INDEX \ | while read -r "${INDEX_FORMAT[@]}"; do # grep from description - if grep --color=always -iq "$1" <<<"$description"; then + local hashtags="$(_hashtags "$description")" + if grep --color=always -iq "$1" <<<"${description%% $hashtags}"; then hint=false mark="$index " _show_list | grep --color=always -Ei "$1" else local repo=$folder/${url##*/} -- cgit v1.2.3-70-g09d2