summaryrefslogtreecommitdiff
path: root/plugins/zsh-navigation-tools/znt-history-widget
diff options
context:
space:
mode:
authorSebastian Gniazdowski <sgniazdowski@gmail.com>2016-01-07 11:06:12 +0100
committerSebastian Gniazdowski <sgniazdowski@gmail.com>2016-01-18 08:53:54 +0100
commit77f93f61c5ee6fea9131a1791bd3b106b4b8da4f (patch)
tree48ec36b466d4028d2db3395abe75edb408f5ce3c /plugins/zsh-navigation-tools/znt-history-widget
parentd30a501b1c6b8e8164b266318e26ce6d2e4719cf (diff)
downloadzsh-77f93f61c5ee6fea9131a1791bd3b106b4b8da4f.tar.gz
zsh-77f93f61c5ee6fea9131a1791bd3b106b4b8da4f.tar.bz2
zsh-77f93f61c5ee6fea9131a1791bd3b106b4b8da4f.zip
znt: optimizations for zsh<=5.2, use $BUFFER if cmd is not from history
Diffstat (limited to 'plugins/zsh-navigation-tools/znt-history-widget')
-rw-r--r--plugins/zsh-navigation-tools/znt-history-widget6
1 files changed, 5 insertions, 1 deletions
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 "$@"