mirror of
https://github.com/zsh-users/zsh
synced 2024-10-14 11:53:24 +00:00
35737: (tweaked c.f. Peter: 35759): use new undo limit for minibuffer and beep when limit is reached
This commit is contained in:
parent
81bfb1a327
commit
5911aca85f
|
@ -1,5 +1,9 @@
|
||||||
2015-07-13 Oliver Kiddle <opk@zsh.org>
|
2015-07-13 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 35737: (tweaked c.f. Peter: 35759): Src/Zle/zle_utils.c,
|
||||||
|
Functions/Zle/read-from-minibuffer: use new undo limit for
|
||||||
|
minibuffer and beep when limit is reached
|
||||||
|
|
||||||
* 35756: Completion/Zsh/Type/_ps1234: use the actual
|
* 35756: Completion/Zsh/Type/_ps1234: use the actual
|
||||||
colours in the completion list for terminal colours
|
colours in the completion list for terminal colours
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ done
|
||||||
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
|
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
|
||||||
|
|
||||||
local readprompt="$1" lbuf_init="$2" rbuf_init="$3"
|
local readprompt="$1" lbuf_init="$2" rbuf_init="$3"
|
||||||
integer changeno=$UNDO_CHANGE_NO
|
integer savelim=$UNDO_LIMIT_NO changeno=$UNDO_CHANGE_NO
|
||||||
|
|
||||||
{
|
{
|
||||||
# Use anonymous function to make sure special values get restored,
|
# Use anonymous function to make sure special values get restored,
|
||||||
|
@ -43,6 +43,8 @@ integer changeno=$UNDO_CHANGE_NO
|
||||||
else
|
else
|
||||||
local NUMERIC
|
local NUMERIC
|
||||||
unset NUMERIC
|
unset NUMERIC
|
||||||
|
zle split-undo
|
||||||
|
UNDO_LIMIT_NO=$UNDO_CHANGE_NO
|
||||||
zle recursive-edit -K main
|
zle recursive-edit -K main
|
||||||
stat=$?
|
stat=$?
|
||||||
(( stat )) || REPLY=$BUFFER
|
(( stat )) || REPLY=$BUFFER
|
||||||
|
@ -52,6 +54,7 @@ integer changeno=$UNDO_CHANGE_NO
|
||||||
# This removes the edits relating to the read from the undo history.
|
# This removes the edits relating to the read from the undo history.
|
||||||
# These aren't useful once we get back to the main editing buffer.
|
# These aren't useful once we get back to the main editing buffer.
|
||||||
zle undo $changeno
|
zle undo $changeno
|
||||||
|
UNDO_LIMIT_NO=savelim
|
||||||
}
|
}
|
||||||
|
|
||||||
return $stat
|
return $stat
|
||||||
|
|
|
@ -1587,7 +1587,7 @@ undo(char **args)
|
||||||
if (prev->changeno < last_change)
|
if (prev->changeno < last_change)
|
||||||
break;
|
break;
|
||||||
if (prev->changeno < undo_limitno && !*args)
|
if (prev->changeno < undo_limitno && !*args)
|
||||||
break;
|
return 1;
|
||||||
if (unapplychange(prev))
|
if (unapplychange(prev))
|
||||||
curchange = prev;
|
curchange = prev;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue