mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-28 23:46:27 +00:00
Assume $E:SHLVL is already set
This commit is contained in:
parent
ecc64be909
commit
e1127f4b72
@ -25,12 +25,8 @@ var oldpwd = $builtin:pwd
|
|||||||
set builtin:before-chdir = [$@builtin:before-chdir [_]{ edit:add-var oldpwd $builtin:pwd }]
|
set builtin:before-chdir = [$@builtin:before-chdir [_]{ edit:add-var oldpwd $builtin:pwd }]
|
||||||
|
|
||||||
# Initialize hook to add directories to zoxide.
|
# Initialize hook to add directories to zoxide.
|
||||||
var shlvl = $E:SHLVL
|
if (builtin:not (builtin:eq $E:__zoxide_hooked_elvish $E:SHLVL)) {
|
||||||
if (builtin:eq $shlvl "") {
|
set E:__zoxide_hooked_elvish = $E:SHLVL
|
||||||
set shlvl = 0
|
|
||||||
}
|
|
||||||
if (builtin:not (builtin:eq $E:__zoxide_hooked_elvish $shlvl)) {
|
|
||||||
set E:__zoxide_hooked_elvish = $shlvl
|
|
||||||
{%- match hook %}
|
{%- match hook %}
|
||||||
{%- when InitHook::None %}
|
{%- when InitHook::None %}
|
||||||
{{ not_configured }}
|
{{ not_configured }}
|
||||||
|
Loading…
Reference in New Issue
Block a user