diff --git a/conf.d/abbr_tips.fish b/conf.d/abbr_tips.fish index b0ee8af..6e0f60e 100644 --- a/conf.d/abbr_tips.fish +++ b/conf.d/abbr_tips.fish @@ -4,6 +4,8 @@ bind \r '_abbr_tips_bind_newline' set -l uninstall (basename (status -f) .fish){_uninstall} +set -g _abbr_tips_is_abbr 0 + function abbr_fish --on-event fish_postexec -d "Abbreviation reminder for the current command" set -l command (string split ' ' "$argv") set -l cmd (string replace -r -a '\\s+' ' ' "$argv" ) diff --git a/functions/_abbr_tips_bind_newline.fish b/functions/_abbr_tips_bind_newline.fish index c18f917..97a00e2 100644 --- a/functions/_abbr_tips_bind_newline.fish +++ b/functions/_abbr_tips_bind_newline.fish @@ -1,8 +1,10 @@ function _abbr_tips_bind_newline - if abbr -q (string trim (commandline)) - set -g _abbr_tips_is_abbr 1 - else - set -g _abbr_tips_is_abbr 0 + if test $_abbr_tips_is_abbr != 1 + if abbr -q (string trim (commandline)) + set -g _abbr_tips_is_abbr 1 + else + set -g _abbr_tips_is_abbr 0 + end end commandline -f 'execute' end