Skip to content

Commit

Permalink
🐛 fix: don't show tips if abbr was used and options added
Browse files Browse the repository at this point in the history
We can use abbreviations and then add some options/arguments to the command, there is no need for tips in this case
  • Loading branch information
gazorby committed Apr 13, 2020
1 parent aa54232 commit a2b5214
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions conf.d/abbr_tips.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down
10 changes: 6 additions & 4 deletions functions/_abbr_tips_bind_newline.fish
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a2b5214

Please sign in to comment.