mirror of
https://github.com/Aloxaf/fzf-tab.git
synced 2026-09-10 07:26:16 -04:00
fix: Preserve FZF_TAB_MODULE_VERSION when module is already loaded
Previously, FZF_TAB_MODULE_VERSION was always unset on source. This caused the variable to be lost when re-sourcing fzf-tab.zsh, because zmodload won't reload an already-loaded module. Now the variable is only unset if the module is not loaded.
This commit is contained in:
parent
cbdc58226a
commit
9fcad3153f
11
fzf-tab.zsh
11
fzf-tab.zsh
|
|
@ -395,10 +395,13 @@ typeset -ga _ftb_group_colors=(
|
|||
# init
|
||||
() {
|
||||
emulate -L zsh -o extended_glob
|
||||
|
||||
# Ensure we don't keep a stale value around
|
||||
# and allow the aloxaf/fzftab module to set it when loaded.
|
||||
unset FZF_TAB_MODULE_VERSION 2>/dev/null
|
||||
|
||||
# Ensure we don't keep a stale value around.
|
||||
# If the module is loaded, the variable is valid; unsetting would lose it
|
||||
# since zmodload won't reload an already-loaded module.
|
||||
if ! zmodload -e aloxaf/fzftab; then
|
||||
unset FZF_TAB_MODULE_VERSION 2>/dev/null
|
||||
fi
|
||||
|
||||
if (( ! $fpath[(I)$FZF_TAB_HOME/lib] )); then
|
||||
fpath+=($FZF_TAB_HOME/lib)
|
||||
|
|
|
|||
Loading…
Reference in a new issue