mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
refactor: use nvim.foo.bar format for autocommand groups
This commit is contained in:
@ -122,7 +122,7 @@ fully disable the mouse or popup-menu, do any of the following:
|
|||||||
<
|
<
|
||||||
To remove the default popup-menu without disabling mouse: >vim
|
To remove the default popup-menu without disabling mouse: >vim
|
||||||
aunmenu PopUp
|
aunmenu PopUp
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
|
|
||||||
To remove only the "How-to disable mouse" menu item (and its separator): >vim
|
To remove only the "How-to disable mouse" menu item (and its separator): >vim
|
||||||
aunmenu PopUp.How-to\ disable\ mouse
|
aunmenu PopUp.How-to\ disable\ mouse
|
||||||
|
@ -21,7 +21,7 @@ local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' }
|
|||||||
|
|
||||||
if not vim.b.disable_query_linter and #query_lint_on > 0 then
|
if not vim.b.disable_query_linter and #query_lint_on > 0 then
|
||||||
vim.api.nvim_create_autocmd(query_lint_on, {
|
vim.api.nvim_create_autocmd(query_lint_on, {
|
||||||
group = vim.api.nvim_create_augroup('querylint', { clear = false }),
|
group = vim.api.nvim_create_augroup('nvim.querylint', { clear = false }),
|
||||||
buffer = buf,
|
buffer = buf,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.treesitter.query.lint(buf)
|
vim.treesitter.query.lint(buf)
|
||||||
|
@ -145,7 +145,7 @@ local vim9 = (function()
|
|||||||
-- work well for calling ":source X" from within a vimscript/vim9script
|
-- work well for calling ":source X" from within a vimscript/vim9script
|
||||||
-- function
|
-- function
|
||||||
M.make_source_cmd = function()
|
M.make_source_cmd = function()
|
||||||
local group = vim.api.nvim_create_augroup('vim9script-source', {})
|
local group = vim.api.nvim_create_augroup('nvim.vim9script_source', {})
|
||||||
vim.api.nvim_create_autocmd('SourceCmd', {
|
vim.api.nvim_create_autocmd('SourceCmd', {
|
||||||
pattern = '*.vim',
|
pattern = '*.vim',
|
||||||
group = group,
|
group = group,
|
||||||
|
@ -151,7 +151,7 @@ function properties.trim_trailing_whitespace(bufnr, val)
|
|||||||
)
|
)
|
||||||
if val == 'true' then
|
if val == 'true' then
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
group = 'editorconfig',
|
group = 'nvim.editorconfig',
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
local view = vim.fn.winsaveview()
|
local view = vim.fn.winsaveview()
|
||||||
@ -163,7 +163,7 @@ function properties.trim_trailing_whitespace(bufnr, val)
|
|||||||
else
|
else
|
||||||
vim.api.nvim_clear_autocmds({
|
vim.api.nvim_clear_autocmds({
|
||||||
event = 'BufWritePre',
|
event = 'BufWritePre',
|
||||||
group = 'editorconfig',
|
group = 'nvim.editorconfig',
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@ -180,7 +180,7 @@ function properties.insert_final_newline(bufnr, val)
|
|||||||
local endofline = val == 'true'
|
local endofline = val == 'true'
|
||||||
if vim.bo[bufnr].endofline ~= endofline then
|
if vim.bo[bufnr].endofline ~= endofline then
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
group = 'editorconfig',
|
group = 'nvim.editorconfig',
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
once = true,
|
once = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
|
@ -412,7 +412,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local nvim_popupmenu_augroup = vim.api.nvim_create_augroup('nvim_popupmenu', {})
|
local nvim_popupmenu_augroup = vim.api.nvim_create_augroup('nvim.popupmenu', {})
|
||||||
vim.api.nvim_create_autocmd('MenuPopup', {
|
vim.api.nvim_create_autocmd('MenuPopup', {
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
group = nvim_popupmenu_augroup,
|
group = nvim_popupmenu_augroup,
|
||||||
@ -429,7 +429,7 @@ end
|
|||||||
|
|
||||||
--- Default autocommands. See |default-autocmds|
|
--- Default autocommands. See |default-autocmds|
|
||||||
do
|
do
|
||||||
local nvim_terminal_augroup = vim.api.nvim_create_augroup('nvim_terminal', {})
|
local nvim_terminal_augroup = vim.api.nvim_create_augroup('nvim.terminal', {})
|
||||||
vim.api.nvim_create_autocmd('BufReadCmd', {
|
vim.api.nvim_create_autocmd('BufReadCmd', {
|
||||||
pattern = 'term://*',
|
pattern = 'term://*',
|
||||||
group = nvim_terminal_augroup,
|
group = nvim_terminal_augroup,
|
||||||
@ -509,14 +509,14 @@ do
|
|||||||
vim.api.nvim_create_autocmd('CmdwinEnter', {
|
vim.api.nvim_create_autocmd('CmdwinEnter', {
|
||||||
pattern = '[:>]',
|
pattern = '[:>]',
|
||||||
desc = 'Limit syntax sync to maxlines=1 in the command window',
|
desc = 'Limit syntax sync to maxlines=1 in the command window',
|
||||||
group = vim.api.nvim_create_augroup('nvim_cmdwin', {}),
|
group = vim.api.nvim_create_augroup('nvim.cmdwin', {}),
|
||||||
command = 'syntax sync minlines=1 maxlines=1',
|
command = 'syntax sync minlines=1 maxlines=1',
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('SwapExists', {
|
vim.api.nvim_create_autocmd('SwapExists', {
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
desc = 'Skip the swapfile prompt when the swapfile is owned by a running Nvim process',
|
desc = 'Skip the swapfile prompt when the swapfile is owned by a running Nvim process',
|
||||||
group = vim.api.nvim_create_augroup('nvim_swapfile', {}),
|
group = vim.api.nvim_create_augroup('nvim.swapfile', {}),
|
||||||
callback = function()
|
callback = function()
|
||||||
local info = vim.fn.swapinfo(vim.v.swapname)
|
local info = vim.fn.swapinfo(vim.v.swapname)
|
||||||
local user = vim.uv.os_get_passwd().username
|
local user = vim.uv.os_get_passwd().username
|
||||||
@ -543,7 +543,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if tty then
|
if tty then
|
||||||
local group = vim.api.nvim_create_augroup('nvim_tty', {})
|
local group = vim.api.nvim_create_augroup('nvim.tty', {})
|
||||||
|
|
||||||
--- Set an option after startup (so that OptionSet is fired), but only if not
|
--- Set an option after startup (so that OptionSet is fired), but only if not
|
||||||
--- already set by the user.
|
--- already set by the user.
|
||||||
|
@ -356,7 +356,7 @@ local bufnr_and_namespace_cacher_mt = {
|
|||||||
-- bufnr -> ns -> Diagnostic[]
|
-- bufnr -> ns -> Diagnostic[]
|
||||||
local diagnostic_cache = {} --- @type table<integer,table<integer,vim.Diagnostic[]>>
|
local diagnostic_cache = {} --- @type table<integer,table<integer,vim.Diagnostic[]>>
|
||||||
do
|
do
|
||||||
local group = api.nvim_create_augroup('DiagnosticBufWipeout', {})
|
local group = api.nvim_create_augroup('nvim.diagnostic.buf_wipeout', {})
|
||||||
setmetatable(diagnostic_cache, {
|
setmetatable(diagnostic_cache, {
|
||||||
--- @param t table<integer,vim.Diagnostic[]>
|
--- @param t table<integer,vim.Diagnostic[]>
|
||||||
--- @param bufnr integer
|
--- @param bufnr integer
|
||||||
|
@ -841,7 +841,7 @@ local function buf_attach(bufnr)
|
|||||||
attached_buffers[bufnr] = true
|
attached_buffers[bufnr] = true
|
||||||
|
|
||||||
local uri = vim.uri_from_bufnr(bufnr)
|
local uri = vim.uri_from_bufnr(bufnr)
|
||||||
local augroup = ('lsp_b_%d_save'):format(bufnr)
|
local augroup = ('nvim.lsp.b_%d_save'):format(bufnr)
|
||||||
local group = api.nvim_create_augroup(augroup, { clear = true })
|
local group = api.nvim_create_augroup(augroup, { clear = true })
|
||||||
api.nvim_create_autocmd('BufWritePre', {
|
api.nvim_create_autocmd('BufWritePre', {
|
||||||
group = group,
|
group = group,
|
||||||
|
@ -171,7 +171,7 @@ end
|
|||||||
-- 1. Implement clearing `bufstate` and event hooks
|
-- 1. Implement clearing `bufstate` and event hooks
|
||||||
-- when no clients in the buffer support the corresponding method.
|
-- when no clients in the buffer support the corresponding method.
|
||||||
-- 2. Then generalize this state management to other LSP modules.
|
-- 2. Then generalize this state management to other LSP modules.
|
||||||
local augroup_setup = api.nvim_create_augroup('vim_lsp_folding_range/setup', {})
|
local augroup_setup = api.nvim_create_augroup('nvim.lsp.folding_range.setup', {})
|
||||||
|
|
||||||
--- Initialize `bufstate` and event hooks, then request folding ranges.
|
--- Initialize `bufstate` and event hooks, then request folding ranges.
|
||||||
--- Manage their lifecycle within this function.
|
--- Manage their lifecycle within this function.
|
||||||
|
@ -30,7 +30,7 @@ local namespaces = setmetatable({}, {
|
|||||||
---@private
|
---@private
|
||||||
M.__namespaces = namespaces
|
M.__namespaces = namespaces
|
||||||
|
|
||||||
local augroup = api.nvim_create_augroup('vim_lsp_codelens', {})
|
local augroup = api.nvim_create_augroup('nvim.lsp.codelens', {})
|
||||||
|
|
||||||
api.nvim_create_autocmd('LspDetach', {
|
api.nvim_create_autocmd('LspDetach', {
|
||||||
group = augroup,
|
group = augroup,
|
||||||
|
@ -630,7 +630,7 @@ local function enable_completions(client_id, bufnr, opts)
|
|||||||
|
|
||||||
-- Set up autocommands.
|
-- Set up autocommands.
|
||||||
local group =
|
local group =
|
||||||
api.nvim_create_augroup(string.format('vim/lsp/completion-%d', bufnr), { clear = true })
|
api.nvim_create_augroup(string.format('nvim.lsp.completion_%d', bufnr), { clear = true })
|
||||||
api.nvim_create_autocmd('CompleteDone', {
|
api.nvim_create_autocmd('CompleteDone', {
|
||||||
group = group,
|
group = group,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
|
@ -5,7 +5,7 @@ local api = vim.api
|
|||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local augroup = api.nvim_create_augroup('vim_lsp_diagnostic', {})
|
local augroup = api.nvim_create_augroup('nvim.lsp.diagnostic', {})
|
||||||
|
|
||||||
local DEFAULT_CLIENT_ID = -1
|
local DEFAULT_CLIENT_ID = -1
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ local bufstates = vim.defaulttable(function(_)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local namespace = api.nvim_create_namespace('nvim.lsp.inlayhint')
|
local namespace = api.nvim_create_namespace('nvim.lsp.inlayhint')
|
||||||
local augroup = api.nvim_create_augroup('vim_lsp_inlayhint', {})
|
local augroup = api.nvim_create_augroup('nvim.lsp.inlayhint', {})
|
||||||
|
|
||||||
--- |lsp-handler| for the method `textDocument/inlayHint`
|
--- |lsp-handler| for the method `textDocument/inlayHint`
|
||||||
--- Store hints for a specific buffer and client
|
--- Store hints for a specific buffer and client
|
||||||
|
@ -166,7 +166,7 @@ function STHighlighter.new(bufnr)
|
|||||||
local self = setmetatable({}, { __index = STHighlighter })
|
local self = setmetatable({}, { __index = STHighlighter })
|
||||||
|
|
||||||
self.bufnr = bufnr
|
self.bufnr = bufnr
|
||||||
self.augroup = api.nvim_create_augroup('vim_lsp_semantic_tokens:' .. bufnr, { clear = true })
|
self.augroup = api.nvim_create_augroup('nvim.lsp.semantic_tokens:' .. bufnr, { clear = true })
|
||||||
self.client_state = {}
|
self.client_state = {}
|
||||||
|
|
||||||
STHighlighter.active[bufnr] = self
|
STHighlighter.active[bufnr] = self
|
||||||
|
@ -1357,7 +1357,7 @@ end
|
|||||||
---@param bufnrs table list of buffers where the preview window will remain visible
|
---@param bufnrs table list of buffers where the preview window will remain visible
|
||||||
---@see autocmd-events
|
---@see autocmd-events
|
||||||
local function close_preview_autocmd(events, winnr, bufnrs)
|
local function close_preview_autocmd(events, winnr, bufnrs)
|
||||||
local augroup = api.nvim_create_augroup('preview_window_' .. winnr, {
|
local augroup = api.nvim_create_augroup('nvim.preview_window_' .. winnr, {
|
||||||
clear = true,
|
clear = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1619,7 +1619,7 @@ function M.open_floating_preview(contents, syntax, opts)
|
|||||||
api.nvim_buf_set_var(bufnr, 'lsp_floating_preview', floating_winnr)
|
api.nvim_buf_set_var(bufnr, 'lsp_floating_preview', floating_winnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
local augroup_name = ('closing_floating_preview_%d'):format(floating_winnr)
|
local augroup_name = ('nvim.closing_floating_preview_%d'):format(floating_winnr)
|
||||||
local ok =
|
local ok =
|
||||||
pcall(api.nvim_get_autocmds, { group = augroup_name, pattern = tostring(floating_winnr) })
|
pcall(api.nvim_get_autocmds, { group = augroup_name, pattern = tostring(floating_winnr) })
|
||||||
if not ok then
|
if not ok then
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
local G = vim.lsp._snippet_grammar
|
local G = vim.lsp._snippet_grammar
|
||||||
local snippet_group = vim.api.nvim_create_augroup('vim/snippet', {})
|
local snippet_group = vim.api.nvim_create_augroup('nvim.snippet', {})
|
||||||
local snippet_ns = vim.api.nvim_create_namespace('nvim.snippet')
|
local snippet_ns = vim.api.nvim_create_namespace('nvim.snippet')
|
||||||
local hl_group = 'SnippetTabstop'
|
local hl_group = 'SnippetTabstop'
|
||||||
local jump_forward_key = '<tab>'
|
local jump_forward_key = '<tab>'
|
||||||
|
@ -183,7 +183,7 @@ local M = {}
|
|||||||
---@type table<integer,TS.FoldInfo>
|
---@type table<integer,TS.FoldInfo>
|
||||||
local foldinfos = {}
|
local foldinfos = {}
|
||||||
|
|
||||||
local group = api.nvim_create_augroup('treesitter/fold', {})
|
local group = api.nvim_create_augroup('nvim.treesitter.fold', {})
|
||||||
|
|
||||||
--- Update the folds in the windows that contain the buffer and use expr foldmethod (assuming that
|
--- Update the folds in the windows that contain the buffer and use expr foldmethod (assuming that
|
||||||
--- the user doesn't use different foldexpr for the same buffer).
|
--- the user doesn't use different foldexpr for the same buffer).
|
||||||
|
@ -442,7 +442,7 @@ function M.inspect_tree(opts)
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local group = api.nvim_create_augroup('treesitter/dev', {})
|
local group = api.nvim_create_augroup('nvim.treesitter.dev', {})
|
||||||
|
|
||||||
api.nvim_create_autocmd('CursorMoved', {
|
api.nvim_create_autocmd('CursorMoved', {
|
||||||
group = group,
|
group = group,
|
||||||
@ -633,7 +633,7 @@ function M.edit_query(lang)
|
|||||||
-- can infer the language later.
|
-- can infer the language later.
|
||||||
api.nvim_buf_set_name(query_buf, string.format('%s/query_editor.scm', lang))
|
api.nvim_buf_set_name(query_buf, string.format('%s/query_editor.scm', lang))
|
||||||
|
|
||||||
local group = api.nvim_create_augroup('treesitter/dev-edit', {})
|
local group = api.nvim_create_augroup('nvim.treesitter.dev_edit', {})
|
||||||
api.nvim_create_autocmd({ 'TextChanged', 'InsertLeave' }, {
|
api.nvim_create_autocmd({ 'TextChanged', 'InsertLeave' }, {
|
||||||
group = group,
|
group = group,
|
||||||
buffer = query_buf,
|
buffer = query_buf,
|
||||||
|
@ -289,7 +289,7 @@ end, false)
|
|||||||
|
|
||||||
api.nvim_create_autocmd('OptionSet', {
|
api.nvim_create_autocmd('OptionSet', {
|
||||||
pattern = { 'runtimepath' },
|
pattern = { 'runtimepath' },
|
||||||
group = api.nvim_create_augroup('ts_query_cache_reset', { clear = true }),
|
group = api.nvim_create_augroup('nvim.treesitter.query_cache_reset', { clear = true }),
|
||||||
callback = function()
|
callback = function()
|
||||||
M.get:clear()
|
M.get:clear()
|
||||||
end,
|
end,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local group = vim.api.nvim_create_augroup('editorconfig', {})
|
local group = vim.api.nvim_create_augroup('nvim.editorconfig', {})
|
||||||
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
|
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
|
||||||
group = group,
|
group = group,
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
|
@ -24,7 +24,7 @@ end, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local augroup = vim.api.nvim_create_augroup('man', {})
|
local augroup = vim.api.nvim_create_augroup('nvim.man', {})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('BufReadCmd', {
|
vim.api.nvim_create_autocmd('BufReadCmd', {
|
||||||
group = augroup,
|
group = augroup,
|
||||||
|
@ -32,7 +32,7 @@ describe('default', function()
|
|||||||
describe('popupmenu', function()
|
describe('popupmenu', function()
|
||||||
it('can be disabled by user', function()
|
it('can be disabled by user', function()
|
||||||
n.clear {
|
n.clear {
|
||||||
args = { '+autocmd! nvim_popupmenu', '+aunmenu PopUp' },
|
args = { '+autocmd! nvim.popupmenu', '+aunmenu PopUp' },
|
||||||
}
|
}
|
||||||
local screen = Screen.new(40, 8)
|
local screen = Screen.new(40, 8)
|
||||||
n.insert([[
|
n.insert([[
|
||||||
|
@ -173,7 +173,7 @@ describe('swapfile detection', function()
|
|||||||
local screen2 = Screen.new(256, 40)
|
local screen2 = Screen.new(256, 40)
|
||||||
screen2._default_attr_ids = nil
|
screen2._default_attr_ids = nil
|
||||||
exec(init)
|
exec(init)
|
||||||
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).
|
command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog).
|
||||||
|
|
||||||
-- With shortmess+=F
|
-- With shortmess+=F
|
||||||
command('set shortmess+=F')
|
command('set shortmess+=F')
|
||||||
@ -277,7 +277,7 @@ describe('swapfile detection', function()
|
|||||||
set_session(nvim1)
|
set_session(nvim1)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
exec(init)
|
exec(init)
|
||||||
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).
|
command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog).
|
||||||
feed(':split Xfile1\n')
|
feed(':split Xfile1\n')
|
||||||
-- The default SwapExists handler does _not_ skip this prompt.
|
-- The default SwapExists handler does _not_ skip this prompt.
|
||||||
screen:expect({
|
screen:expect({
|
||||||
@ -296,7 +296,7 @@ describe('swapfile detection', function()
|
|||||||
set_session(nvim2)
|
set_session(nvim2)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
exec(init)
|
exec(init)
|
||||||
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).
|
command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog).
|
||||||
command('set more')
|
command('set more')
|
||||||
command('au bufadd * let foo_w = wincol()')
|
command('au bufadd * let foo_w = wincol()')
|
||||||
feed(':e Xfile1<CR>')
|
feed(':e Xfile1<CR>')
|
||||||
@ -327,7 +327,7 @@ describe('swapfile detection', function()
|
|||||||
|
|
||||||
exec(init)
|
exec(init)
|
||||||
if not swapexists then
|
if not swapexists then
|
||||||
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).
|
command('autocmd! nvim.swapfile') -- Delete the default handler (which skips the dialog).
|
||||||
end
|
end
|
||||||
command('set nohidden')
|
command('set nohidden')
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ describe(':terminal buffer', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('TermRequest synchronization #27572', function()
|
it('TermRequest synchronization #27572', function()
|
||||||
command('autocmd! nvim_terminal TermRequest')
|
command('autocmd! nvim.terminal TermRequest')
|
||||||
local term = exec_lua([[
|
local term = exec_lua([[
|
||||||
_G.input = {}
|
_G.input = {}
|
||||||
local term = vim.api.nvim_open_term(0, {
|
local term = vim.api.nvim_open_term(0, {
|
||||||
|
@ -176,7 +176,7 @@ local function test_terminal_with_fake_shell(backslash)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('with no argument, acts like jobstart(…,{term=true})', function()
|
it('with no argument, acts like jobstart(…,{term=true})', function()
|
||||||
command('autocmd! nvim_terminal TermClose')
|
command('autocmd! nvim.terminal TermClose')
|
||||||
feed_command('terminal')
|
feed_command('terminal')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ready $ |
|
^ready $ |
|
||||||
@ -246,7 +246,7 @@ local function test_terminal_with_fake_shell(backslash)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('ignores writes if the backing stream closes', function()
|
it('ignores writes if the backing stream closes', function()
|
||||||
command('autocmd! nvim_terminal TermClose')
|
command('autocmd! nvim.terminal TermClose')
|
||||||
feed_command('terminal')
|
feed_command('terminal')
|
||||||
feed('iiXXXXXXX')
|
feed('iiXXXXXXX')
|
||||||
poke_eventloop()
|
poke_eventloop()
|
||||||
@ -258,14 +258,14 @@ local function test_terminal_with_fake_shell(backslash)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('works with findfile()', function()
|
it('works with findfile()', function()
|
||||||
command('autocmd! nvim_terminal TermClose')
|
command('autocmd! nvim.terminal TermClose')
|
||||||
feed_command('terminal')
|
feed_command('terminal')
|
||||||
eq('term://', string.match(eval('bufname("%")'), '^term://'))
|
eq('term://', string.match(eval('bufname("%")'), '^term://'))
|
||||||
eq('scripts/shadacat.py', eval('findfile("scripts/shadacat.py", ".")'))
|
eq('scripts/shadacat.py', eval('findfile("scripts/shadacat.py", ".")'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('works with :find', function()
|
it('works with :find', function()
|
||||||
command('autocmd! nvim_terminal TermClose')
|
command('autocmd! nvim.terminal TermClose')
|
||||||
feed_command('terminal')
|
feed_command('terminal')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ready $ |
|
^ready $ |
|
||||||
|
@ -644,7 +644,7 @@ describe('TUI', function()
|
|||||||
|
|
||||||
aunmenu PopUp
|
aunmenu PopUp
|
||||||
" Delete the default MenuPopup event handler.
|
" Delete the default MenuPopup event handler.
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
||||||
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
||||||
menu PopUp.baz :let g:menustr = 'baz'<CR>
|
menu PopUp.baz :let g:menustr = 'baz'<CR>
|
||||||
|
@ -1094,7 +1094,7 @@ describe('ext_multigrid', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('supports mouse', function()
|
it('supports mouse', function()
|
||||||
command('autocmd! nvim_popupmenu') -- Delete the default MenuPopup event handler.
|
command('autocmd! nvim.popupmenu') -- Delete the default MenuPopup event handler.
|
||||||
insert('some text\nto be clicked')
|
insert('some text\nto be clicked')
|
||||||
screen:expect{grid=[[
|
screen:expect{grid=[[
|
||||||
## grid 1
|
## grid 1
|
||||||
|
@ -841,7 +841,7 @@ describe('ui/ext_popupmenu', function()
|
|||||||
|
|
||||||
aunmenu PopUp
|
aunmenu PopUp
|
||||||
" Delete the default MenuPopup event handler.
|
" Delete the default MenuPopup event handler.
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
||||||
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
||||||
menu PopUp.baz :let g:menustr = 'baz'<CR>
|
menu PopUp.baz :let g:menustr = 'baz'<CR>
|
||||||
@ -4089,7 +4089,7 @@ describe('builtin popupmenu', function()
|
|||||||
set mouse=a mousemodel=popup
|
set mouse=a mousemodel=popup
|
||||||
|
|
||||||
" Delete the default MenuPopup event handler.
|
" Delete the default MenuPopup event handler.
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
aunmenu PopUp
|
aunmenu PopUp
|
||||||
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
menu PopUp.foo :let g:menustr = 'foo'<CR>
|
||||||
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
menu PopUp.bar :let g:menustr = 'bar'<CR>
|
||||||
@ -4946,7 +4946,7 @@ describe('builtin popupmenu', function()
|
|||||||
it(':popup command', function()
|
it(':popup command', function()
|
||||||
exec([[
|
exec([[
|
||||||
" Delete the default MenuPopup event handler.
|
" Delete the default MenuPopup event handler.
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
|
|
||||||
func ChangeMenu()
|
func ChangeMenu()
|
||||||
aunmenu PopUp.&Paste
|
aunmenu PopUp.&Paste
|
||||||
@ -5106,7 +5106,7 @@ describe('builtin popupmenu', function()
|
|||||||
exec([[
|
exec([[
|
||||||
set mousemodel=popup_setpos
|
set mousemodel=popup_setpos
|
||||||
" Delete the default MenuPopup event handler.
|
" Delete the default MenuPopup event handler.
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
aunmenu *
|
aunmenu *
|
||||||
source $VIMRUNTIME/menu.vim
|
source $VIMRUNTIME/menu.vim
|
||||||
call setline(1, join(range(20)))
|
call setline(1, join(range(20)))
|
||||||
|
@ -65,7 +65,7 @@ mapclear
|
|||||||
mapclear!
|
mapclear!
|
||||||
aunmenu *
|
aunmenu *
|
||||||
tlunmenu *
|
tlunmenu *
|
||||||
autocmd! nvim_popupmenu
|
autocmd! nvim.popupmenu
|
||||||
|
|
||||||
" Undo the 'grepprg' and 'grepformat' setting in _defaults.lua.
|
" Undo the 'grepprg' and 'grepformat' setting in _defaults.lua.
|
||||||
set grepprg& grepformat&
|
set grepprg& grepformat&
|
||||||
|
Reference in New Issue
Block a user