diff options
author | Sergey Vlasov <sergey@vlasov.me> | 2024-01-25 23:07:00 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-01-25 23:07:00 +0100 |
commit | 1f47db75fdc8c53c5c778b26ecfa0942ac801f22 (patch) | |
tree | 3e08bda69c9a77e744431b723f6e50fb74b06955 /runtime | |
parent | 92e90a1e102825aa9149262cacfc991264db05df (diff) |
patch 9.1.0059: No event triggered before creating a windowv9.1.0059
Problem: No event is triggered before creating a window.
(Sergey Vlasov)
Solution: Add the WinNewPre event (Sergey Vlasov)
fixes: #10635
closes: #12761
Signed-off-by: Sergey Vlasov <sergey@vlasov.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/autocmd.txt | 15 | ||||
-rw-r--r-- | runtime/doc/tags | 1 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 1 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 3 |
4 files changed, 17 insertions, 3 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 1641361791..5f9f51ecb6 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2024 Jan 23 +*autocmd.txt* For Vim version 9.1. Last change: 2024 Jan 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -381,6 +381,7 @@ Name triggered by ~ |CursorMoved| the cursor was moved in Normal mode |CursorMovedI| the cursor was moved in Insert mode +|WinNewPre| before creating a new window |WinNew| after creating a new window |TabNew| after creating a new tab page |WinClosed| after closing a window @@ -1390,6 +1391,18 @@ WinLeave Before leaving a window. If the window to be WinLeave autocommands (but not for ":new"). Not used for ":qa" or ":q" when exiting Vim. + *WinNewPre* +WinNewPre Before creating a new window. Triggered + before commands that modify window layout by + creating a split or new tab page. Not done for + the first window, when Vim has just started. + It is not allowed to modify window layout + while executing commands for the WinNewPre + event. + Most useful to store current window layout + and compare it with the new layout after the + Window has been created. + *WinNew* WinNew When a new window was created. Not done for the first window, when Vim has just started. diff --git a/runtime/doc/tags b/runtime/doc/tags index 9a89916e08..ee6c0a9dd1 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5785,6 +5785,7 @@ WinClosed autocmd.txt /*WinClosed* WinEnter autocmd.txt /*WinEnter* WinLeave autocmd.txt /*WinLeave* WinNew autocmd.txt /*WinNew* +WinNewPre autocmd.txt /*WinNewPre* WinResized autocmd.txt /*WinResized* WinResized-event windows.txt /*WinResized-event* WinScrolled autocmd.txt /*WinScrolled* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index c29ac2e2c0..bb58597a40 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -4667,7 +4667,6 @@ GUI: Autocommands: -9 Add WinNewPre - before creating a new window. #10635 9 When triggering WinNew provide the window ID somehow. #10633 9 Rework the code from FEAT_OSFILETYPE for autocmd-osfiletypes to use 'filetype'. Only for when the current buffer is known. diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 46fe5684a3..73884cc7fd 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -11,6 +11,7 @@ " 2024 Jan 14 by Vim Project (TermResponseAll autocommand) " 2024 Jan 15 by Vim Project (:hi ctermfont attribute) " 2024 Jan 23 by Vim Project (add :[23]match commands) +" 2024 Jan 25 by Vim Project (WinNewPre autocommand) " Version: 9.0-25 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -76,7 +77,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 TermResponseAll 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 WinNewPre 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 |