mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-23 17:01:05 +02:00
20145: Additional arguments to read-from-minibuffer specify initial values
of LBUFFER and RBUFFER.
This commit is contained in:
parent
86ae90bc1c
commit
def0167e34
3 changed files with 19 additions and 5 deletions
|
@ -8,6 +8,12 @@
|
||||||
prompt variable is always reread; fixes bug that if PS1
|
prompt variable is always reread; fixes bug that if PS1
|
||||||
was altered the prompt string was invalid.
|
was altered the prompt string was invalid.
|
||||||
|
|
||||||
|
2004-07-10 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 20145: Doc/Zsh/contrib.yo, Functions/Zle/read-from-minibuffer:
|
||||||
|
second and third arguments of read-from-minibuffer now specify the
|
||||||
|
initial values of LBUFFER and RBUFFER.
|
||||||
|
|
||||||
2004-07-07 Peter Stephenson <pws@csr.com>
|
2004-07-07 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* 20142: Test/A06assign.ztst: add test for bug fixed in
|
* 20142: Test/A06assign.ztst: add test for bug fixed in
|
||||||
|
|
|
@ -742,12 +742,20 @@ when executing, for example, tt(execute-named-cmd)). The value is then
|
||||||
returned to the calling function in the parameter tt($REPLY) and the
|
returned to the calling function in the parameter tt($REPLY) and the
|
||||||
editing buffer restored to its previous state. If the read was aborted
|
editing buffer restored to its previous state. If the read was aborted
|
||||||
by a keyboard break (typically tt(^G)), the function returns status 1
|
by a keyboard break (typically tt(^G)), the function returns status 1
|
||||||
and tt($REPLY) is not set. If an argument is supplied to the function
|
and tt($REPLY) is not set.
|
||||||
it is taken as a prompt, otherwise `tt(? )' is used.
|
|
||||||
|
If one argument is supplied to the function it is taken as a prompt,
|
||||||
|
otherwise `tt(? )' is used. If two arguments are supplied, they are the
|
||||||
|
prompt and the initial value of tt($LBUFFER), and if a third argument is
|
||||||
|
given it is the initial value of tt($RBUFFER). This provides a default
|
||||||
|
value and starting cursor placement. Upon return the entire buffer is the
|
||||||
|
value of tt($REPLY).
|
||||||
|
|
||||||
One option is available: `tt(-k) var(num)' specifies that var(num)
|
One option is available: `tt(-k) var(num)' specifies that var(num)
|
||||||
characters are to be read instead of a whole line. The line editor is not
|
characters are to be read instead of a whole line. The line editor is not
|
||||||
invoked recursively in this case. Note that unlike the tt(read) builtin
|
invoked recursively in this case, so depending on the terminal settings
|
||||||
|
the input may not be visible, and only the input keys are placed in
|
||||||
|
tt($REPLY), not the entire buffer. Note that unlike the tt(read) builtin
|
||||||
var(num) must be given; there is no default.
|
var(num) must be given; there is no default.
|
||||||
|
|
||||||
The name is a slight misnomer, as in fact the shell's own minibuffer is
|
The name is a slight misnomer, as in fact the shell's own minibuffer is
|
||||||
|
|
|
@ -20,8 +20,8 @@ done
|
||||||
local savelbuffer=$LBUFFER saverbuffer=$RBUFFER
|
local savelbuffer=$LBUFFER saverbuffer=$RBUFFER
|
||||||
local savepredisplay=$PREDISPLAY savepostdisplay=$POSTDISPLAY
|
local savepredisplay=$PREDISPLAY savepostdisplay=$POSTDISPLAY
|
||||||
|
|
||||||
LBUFFER=
|
LBUFFER="$2"
|
||||||
RBUFFER=
|
RBUFFER="$3"
|
||||||
PREDISPLAY="$PREDISPLAY$savelbuffer$saverbuffer$POSTDISPLAY
|
PREDISPLAY="$PREDISPLAY$savelbuffer$saverbuffer$POSTDISPLAY
|
||||||
${1:-? }"
|
${1:-? }"
|
||||||
POSTDISPLAY=
|
POSTDISPLAY=
|
||||||
|
|
Loading…
Reference in a new issue