summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDanek Duvall <duvall@comfychair.org>2024-01-14 20:19:59 +0100
committerChristian Brabandt <cb@256bit.org>2024-01-14 20:19:59 +0100
commitd7d560374b836e62e180914b6e85f0eb20557a54 (patch)
treef3ca271789492e49cf8a0ac5b85cdf4aef6c6ecb /runtime
parent1f13fcc9342e66842bf9847d01e585ea2c2b6b30 (diff)
patch 9.1.0029: Cannot act on various terminal response codesv9.1.0029
Problem: Cannot act on various terminal response codes Solution: Add the TerminalResponseAll autocommand (Danek Duvall) closes: #13829 Signed-off-by: Danek Duvall <duvall@comfychair.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt21
-rw-r--r--runtime/doc/eval.txt27
-rw-r--r--runtime/doc/tags1
-rw-r--r--runtime/doc/todo.txt5
-rw-r--r--runtime/syntax/vim.vim3
5 files changed, 43 insertions, 14 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 2ac0247bb0..0ace7b1dae 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 9.1. Last change: 2023 May 20
+*autocmd.txt* For Vim version 9.1. Last change: 2024 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -340,6 +340,7 @@ Name triggered by ~
|GUIEnter| after starting the GUI successfully
|GUIFailed| after starting the GUI failed
|TermResponse| after the terminal response to |t_RV| is received
+|TermResponseAll| after the terminal response to |t_RV| and others is received
|QuitPre| when using `:quit`, before deciding whether to exit
|ExitPre| when using a command that may make Vim exit
@@ -1220,6 +1221,24 @@ TermResponse After the response to |t_RV| is received from
triggered halfway executing another event,
especially if file I/O, a shell command or
anything else that takes time is involved.
+ *TermResponseAll*
+TermResponseAll After the response to |t_RV|, |t_RC|, |t_RS|,
+ |t_RB|, |t_RF|, or |t_u7| are received from
+ the terminal. The value of |v:termresponse|,
+ |v:termblinkresp|, |v:termstyleresp|,
+ |v:termrbgresp|, |v:termrfgresp|, and
+ |v:termu7resp|, correspondingly, can be used.
+ <amatch> will be set to any of:
+ "version",
+ "cursorblink",
+ "cursorshape",
+ "background",
+ "foreground",
+ "ambiguouswidth"
+ Note that this event may be triggered halfway
+ executing another event, especially if file I/O,
+ a shell command or anything else that takes time
+ is involved.
*TextChanged*
TextChanged After a change was made to the text in the
current buffer in Normal mode. That is after
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d52f7fe169..9c12fb8504 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 9.1. Last change: 2023 Dec 09
+*eval.txt* For Vim version 9.1. Last change: 2024 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2568,8 +2568,9 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
'c', with only digits and ';' in between.
When this option is set, the TermResponse autocommand event is
fired, so that you can react to the response from the
- terminal. You can use |terminalprops()| to see what Vim
- figured out about the terminal.
+ terminal. The TermResponseAll event is also fired, with
+ <amatch> set to "version". You can use |terminalprops()| to see
+ what Vim figured out about the terminal.
The response from a new xterm is: "<Esc>[> Pp ; Pv ; Pc c". Pp
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
patch level (since this was introduced in patch 95, it's
@@ -2581,27 +2582,37 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV|
*v:termblinkresp*
v:termblinkresp The escape sequence returned by the terminal for the |t_RC|
termcap entry. This is used to find out whether the terminal
- cursor is blinking. This is used by |term_getcursor()|.
+ cursor is blinking. This is used by |term_getcursor()|. When
+ this option is set, the TermResponseAll autocommand event is
+ fired, with <amatch> set to "cursorblink".
*v:termstyleresp*
v:termstyleresp The escape sequence returned by the terminal for the |t_RS|
termcap entry. This is used to find out what the shape of the
- cursor is. This is used by |term_getcursor()|.
+ cursor is. This is used by |term_getcursor()|. When this
+ option is set, the TermResponseAll autocommand event is fired,
+ with <amatch> set to "cursorshape".
*v:termrbgresp*
v:termrbgresp The escape sequence returned by the terminal for the |t_RB|
termcap entry. This is used to find out what the terminal
- background color is, see 'background'.
+ background color is; see 'background'. When this option is
+ set, the TermResponseAll autocommand event is fired, with
+ <amatch> set to "background".
*v:termrfgresp*
v:termrfgresp The escape sequence returned by the terminal for the |t_RF|
termcap entry. This is used to find out what the terminal
- foreground color is.
+ foreground color is. When this option is set, the
+ TermResponseAll autocommand event is fired, with <amatch> set
+ to "foreground".
*v:termu7resp*
v:termu7resp The escape sequence returned by the terminal for the |t_u7|
termcap entry. This is used to find out what the terminal
- does with ambiguous width characters, see 'ambiwidth'.
+ does with ambiguous width characters, see 'ambiwidth'. When
+ this option is set, the TermResponseAll autocommand event is
+ fired, with <amatch> set to "ambiguouswidth".
*v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index caa76bcc47..88518600f6 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5706,6 +5706,7 @@ TabNew autocmd.txt /*TabNew*
Tcl if_tcl.txt /*Tcl*
TermChanged autocmd.txt /*TermChanged*
TermResponse autocmd.txt /*TermResponse*
+TermResponseAll autocmd.txt /*TermResponseAll*
TermdebugStartPost terminal.txt /*TermdebugStartPost*
TermdebugStartPre terminal.txt /*TermdebugStartPre*
TermdebugStopPost terminal.txt /*TermdebugStopPost*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 746488ecc4..c29ac2e2c0 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 9.1. Last change: 2023 Dec 14
+*todo.txt* For Vim version 9.1. Last change: 2024 Jan 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1121,9 +1121,6 @@ When t_Co is changed from termresponse, the OptionSet autocommand event isn't
triggered. Use the code from the end of set_num_option() in
set_color_count().
-Add another autocommand like TermResponse that is fired for the other terminal
-responses, such as bg and fg. Use "bg", "fg", "blink", etc. for the name.
-
When using command line window, CmdlineLeave is triggered without
CmdlineEnter. (xtal8, 2017 Oct 30, #2263)
Add some way to get the nested state. Although CmdwinEnter is obviously
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 165a809596..12e6f34741 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -8,6 +8,7 @@
" 2023 Dec 10 by Vim Project (improve variable matching)
" 2023 Dec 21 by Vim Project (improve ex command matching)
" 2023 Dec 30 by Vim Project (:syntax improvements)
+" 2024 Jan 14 by Vim Project (TermResponseAll autocommand)
" Version: 9.0-25
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
" Automatically generated keyword lists: {{{1
@@ -73,7 +74,7 @@ syn keyword vimErrSetting contained bioskey biosk conskey consk autoprint beauti
" AutoCmd Events {{{2
syn case ignore
-syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWrite BufWritePost CmdlineChanged CmdlineLeave CmdwinEnter ColorScheme CompleteChanged CompleteDonePre CursorHoldI CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileExplorer FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinResized WinScrolled
+syn keyword vimAutoEvent contained BufAdd BufDelete BufFilePost BufHidden BufNew BufRead BufReadPost BufUnload BufWinLeave BufWrite BufWritePost CmdlineChanged CmdlineLeave CmdwinEnter ColorScheme CompleteChanged CompleteDonePre CursorHoldI CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileExplorer FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinResized WinScrolled
syn keyword vimAutoEvent contained BufCreate BufEnter BufFilePre BufLeave BufNewFile BufReadCmd BufReadPre BufWinEnter BufWipeout BufWriteCmd BufWritePre CmdlineEnter CmdUndefined CmdwinLeave ColorSchemePre CompleteDone CursorHold CursorMoved
" Highlight commonly used Groupnames {{{2