diff options
Diffstat (limited to 'Doc/Zsh/zle.yo')
-rw-r--r-- | Doc/Zsh/zle.yo | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index d3624b1ce..3e8c25a90 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -877,6 +877,12 @@ any predisplay string should be highlighted in bold. Note that the effect of tt(region_highlight) is not saved and disappears as soon as the line is accepted. ) +vindex(UNDO_CHANGE_NO) +item(tt(UNDO_CHANGE_NO) (integer))( +A number representing the state of the undo history. The only use +of this is passing as an argument to the tt(undo) widget in order to +undo back to the recorded point. Read-only. +) vindex(WIDGET) item(tt(WIDGET) (scalar))( The name of the widget currently being executed; read-only. @@ -902,11 +908,20 @@ item(tt(ZLE_STATE) (scalar))( Contains a set of space-separated words that describe the current tt(zle) state. -Currently, the only state shown is the insert mode as set by the -tt(overwrite-mode) or tt(vi-replace) widgets. The string contains -`tt(insert)' if characters to be inserted on the command line move existing -characters to the right, `tt(overwrite)' if characters to be inserted -overwrite existing characters. +Currently, the states shown are the insert mode as set by the +tt(overwrite-mode) or tt(vi-replace) widgets and whether history commands +will visit imported entries as controlled by the set-local-history widget. +The string contains `tt(insert)' if characters to be inserted on the +command line move existing characters to the right or `tt(overwrite)' +if characters to be inserted overwrite existing characters. It contains +`tt(localhistory)' if only local history commands will be visited or +`tt(globalhistory)' if imported history commands will also be visited. + +The substrings are sorted in alphabetical order so that if you want to +test for two specific substrings in a future-proof way, you can do match +by doing: + +example(if [[ $ZLE_STATE == *insert*globalhistory* ]]; then ...; fi) ) enditem() @@ -1464,6 +1479,13 @@ Search forward in the history for a line beginning with the current line up to the cursor. This leaves the cursor in its original position. ) +tindex(set-local-history) +item(tt(set-local-history))( +By default, history movement commands visit the imported lines as well as +the local lines. This widget lets you toggle this on and off, or set it with +the numeric argument. Zero for both local and imported lines and nonzero for +only local lines. +) enditem() texinode(Modifying Text)(Arguments)(History Control)(Zle Widgets) subsect(Modifying Text) @@ -2164,7 +2186,10 @@ command is typed. By default it beeps. ) tindex(undo) item(tt(undo) (^_ ^Xu ^X^U) (unbound) (unbound))( -Incrementally undo the last text modification. +Incrementally undo the last text modification. When called from a +user-defined widget, takes an optional argument indicating a previous state +of the undo history as returned by the tt(UNDO_CHANGE_NO) variable; +modifications are undone until that state is reached. ) tindex(redo) item(tt(redo))( |