From 530cd7f76b9e7e129ad79b67fcf222f7278fc6da Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 16 Jan 2024 11:01:39 +0100 Subject: [PATCH] fix(history-substring-search): source properly plugin --- .../history-substring-search.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh index 05bdbcd75..63f0bdd42 100644 --- a/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -1,5 +1,9 @@ -0=${(%):-%N} -source ${0:A:h}/zsh-history-substring-search.zsh +# Handle $0 according to the standard: +# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html +0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" +0="${${(M)0:#/*}:-$PWD/$0}" + +source ${0:A:h}/history-substring-search.zsh # Bind terminal-specific up and down keys