From 77f93f61c5ee6fea9131a1791bd3b106b4b8da4f Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Thu, 7 Jan 2016 11:06:12 +0100 Subject: znt: optimizations for zsh<=5.2, use $BUFFER if cmd is not from history --- plugins/zsh-navigation-tools/znt-history-widget | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/zsh-navigation-tools/znt-history-widget') diff --git a/plugins/zsh-navigation-tools/znt-history-widget b/plugins/zsh-navigation-tools/znt-history-widget index 9ddae606d..a4a26cbfc 100644 --- a/plugins/zsh-navigation-tools/znt-history-widget +++ b/plugins/zsh-navigation-tools/znt-history-widget @@ -1,7 +1,11 @@ autoload znt-usetty-wrapper n-history local NLIST_START_IN_SEARCH_MODE=1 local NLIST_START_IN_UNIQ_MODE=1 -local NLIST_SET_SEARCH_TO="$BUFFER" + +# Only if current $BUFFER doesn't come from history +if [ "$HISTCMD" = "$HISTNO" ]; then + local NLIST_SET_SEARCH_TO="$BUFFER" +fi znt-usetty-wrapper n-history "$@" -- cgit v1.2.3-70-g09d2