diff options
-rwxr-xr-x | gist | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -385,7 +385,8 @@ _grep_content() { | |||
385 | # grep from filenames | 385 | # grep from filenames |
386 | local file=$(ls $repo | grep --color=always -Ei "$1") | 386 | local file=$(ls $repo | grep --color=always -Ei "$1") |
387 | # grep from content of files | 387 | # grep from content of files |
388 | local content=$(grep --color=always -EHi -m1 "$1" * | head -1) | 388 | # Abort error message to prevent weird file name, for example: https://gist.github.com/6057f4a3a533f7992c60 |
389 | local content=$(grep --color=always -EHi -m1 "$1" * 2>/dev/null | head -1) | ||
389 | 390 | ||
390 | [[ -n $file && file="$file\n" || -n $content ]] \ | 391 | [[ -n $file && file="$file\n" || -n $content ]] \ |
391 | && hint=false mark="$index " _show_list \ | 392 | && hint=false mark="$index " _show_list \ |