* PATCH: always last prompt
@ 1999-07-12 8:14 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-07-12 8:14 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-07-12 8:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-12 8:14 PATCH: always last prompt Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).