summaryrefslogtreecommitdiff
path: root/plugins/zsh-navigation-tools/n-history
diff options
context:
space:
mode:
authorSebastian Gniazdowski <sgniazdowski@gmail.com>2015-11-30 10:48:30 +0100
committerSebastian Gniazdowski <sgniazdowski@gmail.com>2015-11-30 10:48:30 +0100
commitc2b4d9ff40f2f965a5d9d282081f3f8bf51bb5b5 (patch)
treeb96ce8d323c999bc6cfb62fbdddd4ae8f7ba2b5b /plugins/zsh-navigation-tools/n-history
parentafd28bf1fc22f53c4a1af3f5836ca428affb34b3 (diff)
downloadzsh-c2b4d9ff40f2f965a5d9d282081f3f8bf51bb5b5.tar.gz
zsh-c2b4d9ff40f2f965a5d9d282081f3f8bf51bb5b5.tar.bz2
zsh-c2b4d9ff40f2f965a5d9d282081f3f8bf51bb5b5.zip
znt: n-history supports multi-line cmds and starts with current buffer
Diffstat (limited to 'plugins/zsh-navigation-tools/n-history')
-rw-r--r--plugins/zsh-navigation-tools/n-history7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/zsh-navigation-tools/n-history b/plugins/zsh-navigation-tools/n-history
index e66f2a50a..c9e53316b 100644
--- a/plugins/zsh-navigation-tools/n-history
+++ b/plugins/zsh-navigation-tools/n-history
@@ -10,6 +10,7 @@ emulate -L zsh
setopt extendedglob
zmodload zsh/curses
+zmodload zsh/parameter
local IFS="
"
@@ -24,16 +25,16 @@ local selected
NLIST_REMEMBER_STATE=0
-list=( `builtin history -rn 1` )
+list=( "$history[@]" )
list=( "${(@M)list:#(#i)*$1*}" )
-local NLIST_GREP_STRING="$1"
-
if [ "$#list" -eq 0 ]; then
echo "No matching history entries"
return 1
fi
+local NLIST_GREP_STRING="$1"
+local NLIST_REPLACE_NEWLINES="1"
n-list "${list[@]}"
if [ "$REPLY" -gt 0 ]; then