Highlight search keywords in results

This commit is contained in:
Les De Ridder 2019-03-24 09:53:45 +01:00
parent 0c7f1d7e8d
commit 899ba881a6
1 changed files with 12 additions and 2 deletions

14
saury
View File

@ -102,7 +102,12 @@ function aur_search
set_color --bold
echo -n (string join "" \
(set_color CC3399) "aur/" \
(set_color normal; set_color --bold) "$name")
(set_color normal; set_color --bold) (string replace -a -i \
"$query" \
(string join "" (set_color 33CCB3) \
"$query" \
(set_color normal; set_color --bold)) \
"$name"))
echo -n ' '
if test $out_of_date = "true"
@ -144,7 +149,12 @@ function aur_search
echo
set_color normal
echo " $description"
echo (string replace -a -i \
"$query" \
(string join "" (set_color 33CCB3) \
"$query" \
(set_color normal)) \
" $description")
end
else if test "$rpc_response_type" = "error"
set rpc_error (echo $rpc_response | jq -r '.error')