about summary refs log tree commit diff
path: root/Completion/Commands
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-29 22:56:23 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-29 22:56:23 +0000
commit9fd7cbf751de1f3faec8b689132d4401efe02547 (patch)
tree58eaa02fa01c43551a5f97cb94457f2f898f15cb /Completion/Commands
parentce102e65de28d4f77f9d8c58721c75ab7923ce08 (diff)
downloadzsh-9fd7cbf751de1f3faec8b689132d4401efe02547.tar.gz
zsh-9fd7cbf751de1f3faec8b689132d4401efe02547.tar.xz
zsh-9fd7cbf751de1f3faec8b689132d4401efe02547.zip
zsh-workers/8098
Diffstat (limited to 'Completion/Commands')
-rw-r--r--Completion/Commands/_history_complete_word20
1 files changed, 6 insertions, 14 deletions
diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word
index 8c531a12b..ecd2471e5 100644
--- a/Completion/Commands/_history_complete_word
+++ b/Completion/Commands/_history_complete_word
@@ -1,4 +1,4 @@
-#compdef -k complete-word \e/ \e,
+#compdef -K _history-complete-older complete-word \e/ _history-complete-newer complete-word \e,
 #
 # Complete words from the history
 #
@@ -19,19 +19,11 @@
 _history_complete_word () {
   local expl direction
 
-  case "$KEYS" in 
-    ',')  direction='newer'
-            ;;
-    '/')  direction='older'
-            ;;
-        *)  print <<EOF
-The keypress \`$KEYS\' was not understood by _history_complete_word.
-You must alter _history_complete_word if you want to bind it to keys
-other than the defaults, so that it knows which direction the key
-should move in the history.
-EOF
-            return 1
-  esac
+  if [[ $WIDGET = *newer ]]; then
+    direction=older
+  else
+    direction=newer
+  fi
 
   [[ -z "$compconfig[history_list]" ]] && compstate[list]=''