diff --git a/tests/test_aliases.zunit b/tests/test_aliases.zunit index 521c6b0..4a27a84 100644 --- a/tests/test_aliases.zunit +++ b/tests/test_aliases.zunit @@ -133,11 +133,11 @@ assert $state equals 0 } -@test 'issue 79 - expands aliases' { +@test 'expands aliases to find potentially better matches' { alias gd='git diff' alias gdw='git diff --word-diff' - run _check_aliases "gd --word-diff" + run _check_aliases "gd --word-diff" "git diff --word-diff" assert $output contains 'You should use: "gdw"' assert $state equals 0 -} \ No newline at end of file +} diff --git a/you-should-use.plugin.zsh b/you-should-use.plugin.zsh index aad3e25..3701ea6 100644 --- a/you-should-use.plugin.zsh +++ b/you-should-use.plugin.zsh @@ -191,7 +191,10 @@ function _check_aliases() { continue fi - if [[ "$typed" = "$value" || "$typed" = "$value "* ]]; then + if [[ "$typed" = "$value" || \ + "$typed" = "$value "* || + "$expanded" = "$value" || \ + "$expanded" = "$value "* ]]; then # if the alias longer or the same length as its command # we assume that it is there to cater for typos.