Skip to content

Commit

Permalink
πŸ› fix: reset abbr status after displaying tip
Browse files Browse the repository at this point in the history
  • Loading branch information
gazorby committed Apr 13, 2020
1 parent 421ede5 commit 46c70c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conf.d/abbr_tips.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function abbr_fish --on-event fish_postexec -d "Abbreviation reminder for the cu
# or it's a function
if abbr -q "$cmd"
or ! type -q "$command[1]"
or test "$_abbr_tips_is_abbr" = 1
or test $_abbr_tips_is_abbr = 1
return
end
if test (type -t "$command[1]") = 'function'
Expand All @@ -32,6 +32,7 @@ function abbr_fish --on-event fish_postexec -d "Abbreviation reminder for the cu
or set -l abb (contains -i -- (string replace -r -a '((-{1,2})\\w+)(\\s\\S+)' '$1' "$cmd") $_ABBR_TIPS_VALUES)
or set -l abb (contains -i -- (string replace -r -a '(^( ?\\w+){2}).*' '$1' "$cmd") $_ABBR_TIPS_VALUES)
or set -l abb (contains -i -- (string replace -r -a '(^( ?\\w+){3}).*' '$1' "$cmd") $_ABBR_TIPS_VALUES)
set -g _abbr_tips_is_abbr 0
echo -e "\nπŸ’‘ \e[1m$_ABBR_TIPS_KEYS[$abb]\e[0m => $_ABBR_TIPS_VALUES[$abb]"
return
end
Expand Down

0 comments on commit 46c70c1

Please sign in to comment.