From 853ba3410341f2d575757b299d21c93a70473359 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 26 Jul 2015 21:28:32 +0300 Subject: syntax: List NeoVim-specific autocmd events Note: list was copied from master (7a6bf3f418c5ad94ac2ac71f21275a87d08e87b9). I did not add more events there. --- scripts/genvimvim.lua | 22 ++++++++++++++++++---- src/nvim/auevents.lua | 10 +++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/scripts/genvimvim.lua b/scripts/genvimvim.lua index 582531d8f4..55e57f2f1a 100644 --- a/scripts/genvimvim.lua +++ b/scripts/genvimvim.lua @@ -80,14 +80,28 @@ local vimau_start = 'syn keyword vimAutoEvent contained ' w('\n\n' .. vimau_start) for _, au in ipairs(auevents.events) do - if lld.line_length > 850 then - w('\n' .. vimau_start) + if not auevents.neovim_specific[au] then + if lld.line_length > 850 then + w('\n' .. vimau_start) + end + w(' ' .. au) end - w(' ' .. au) end for au, _ in pairs(auevents.aliases) do + if not auevents.neovim_specific[au] then + if lld.line_length > 850 then + w('\n' .. vimau_start) + end + w(' ' .. au) + end +end + +local nvimau_start = 'syn keyword nvimAutoEvent contained ' +w('\n\n' .. nvimau_start) + +for au, _ in pairs(auevents.neovim_specific) do if lld.line_length > 850 then - w('\n' .. vimau_start) + w('\n' .. nvimau_start) end w(' ' .. au) end diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua index df8e907348..af801c6f1a 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -94,5 +94,13 @@ return { BufRead = 'BufReadPost', BufWrite = 'BufWritePre', FileEncoding = 'EncodingChanged', - } + }, + -- List of neovim-specific events or aliases for the purpose of generating + -- syntax file + neovim_specific = { + TabNew=true, + TabNewEntered=true, + TabClosed=true, + TermEnter=true, + }, } -- cgit