Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: always last prompt
- X-seq: zsh-workers 7099
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: always last prompt
- Date: Mon, 12 Jul 1999 10:14:50 +0200 (MET DST)
If you have alwayslastprompt set and use e.g. the _expand completer
with a numeric argument, the cursor will not be moved up because
alwastlastprompt just toggles between moving up with or without a
numeric argument. So I've just added another configuration key for
_main_complete that allows one to say that it should move up
unconditionally.
Bye
Sven
diff -u oc/Core/_main_complete Completion/Core/_main_complete
--- oc/Core/_main_complete Thu Jul 8 11:11:49 1999
+++ Completion/Core/_main_complete Mon Jul 12 10:07:12 1999
@@ -15,9 +15,13 @@
# any matches, correction is tried and if that doesn't yield
# anything either, correcting completion is attempted.
#
-# These completer functions are only used when this function is called
-# without arguments. If arguments are given, they should be names of
-# completer functions which will then be called.
+# These completer functions are only used when this function is called
+# without arguments. If arguments are given, they should be names of
+# completer functions which will then be called.
+#
+# last_prompt
+# If this is set to `always' the cursor is moved up to the last prompt
+# after printing a list even if a numeric argument was given.
# If you want to complete only set or unset options for the unsetopt
@@ -59,6 +63,8 @@
break;
fi
done
+
+[[ "$compconfig[last_prompt]" = always ]] && compstate[last_prompt]=yes
_lastcomp=( "${(@kv)compstate}" )
_lastcomp[completer]="$comp"
diff -u od/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- od/Zsh/compsys.yo Fri Jul 9 15:48:10 1999
+++ Doc/Zsh/compsys.yo Mon Jul 12 10:10:24 1999
@@ -249,6 +249,11 @@
called. If the return value is zero, no other completers are tried and the
tt(_main_complete) function returns.
+The widget function tt(_main_complete) also uses the configuration key
+tt(last_prompt). If this is set to tt(always), the cursor is moved up
+to the last prompt after printing a list of matches even if a numeric
+argument was given.
+
The following completer functions are contained in the distribution (users
may write their own):
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author