ef5e9945a08eb348f9da6a4be3a7461bbd79151f
- Author
- Michael Aquilina <michaelaquilina@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Merge pull request #20 from MichaelAquilina/use_chpwd
Use chpwd instead of precmd
Diff
1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
2index 50ce0ece9b6ccf9cb94be5b8fba82720e6e4ea79..080003cea50c82b300b2687264fac40a252e4b67 100644
3--- a/autoswitch_virtualenv.plugin.zsh
4+++ b/autoswitch_virtualenv.plugin.zsh
5@@ -131,5 +131,5 @@ function mkvenv()
6 }
7
8 autoload -Uz add-zsh-hook
9-add-zsh-hook -D precmd _check_venv
10-add-zsh-hook precmd _check_venv
11+add-zsh-hook -D chpwd _check_venv
12+add-zsh-hook chpwd _check_venv
13diff --git a/tests/test_check_venv_path.zunit b/tests/test_check_venv_path.zunit
14index e8bf5e98bd8608d8f76602120df143a8b8067436..9565eedb8f6e6eae0b24c2d43170e57c56076b44 100644
15--- a/tests/test_check_venv_path.zunit
16+++ b/tests/test_check_venv_path.zunit
17@@ -10,8 +10,8 @@
18 rm -rf "$target"
19 }
20
21-@test 'precmd functions are loaded' {
22- assert '_check_venv' in $precmd_functions
23+@test 'chpwd functions are loaded' {
24+ assert '_check_venv' in $chpwd_functions
25 }
26
27 @test '_check_venv_path with non-existent path' {