mirror of
https://github.com/neovim/neovim
synced 2025-07-20 03:02:17 +00:00
fix(defaults): use augroup for default autocommands (#26933)
This commit is contained in:
@ -190,6 +190,8 @@ for _, ui in ipairs(vim.api.nvim_list_uis()) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if tty then
|
if tty then
|
||||||
|
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.
|
||||||
---
|
---
|
||||||
@ -207,6 +209,7 @@ if tty then
|
|||||||
vim.o[option] = value
|
vim.o[option] = value
|
||||||
else
|
else
|
||||||
vim.api.nvim_create_autocmd('VimEnter', {
|
vim.api.nvim_create_autocmd('VimEnter', {
|
||||||
|
group = group,
|
||||||
once = true,
|
once = true,
|
||||||
nested = true,
|
nested = true,
|
||||||
callback = function()
|
callback = function()
|
||||||
@ -295,6 +298,7 @@ if tty then
|
|||||||
local timer = assert(vim.uv.new_timer())
|
local timer = assert(vim.uv.new_timer())
|
||||||
|
|
||||||
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
||||||
|
group = group,
|
||||||
nested = true,
|
nested = true,
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local resp = args.data ---@type string
|
local resp = args.data ---@type string
|
||||||
@ -370,6 +374,7 @@ if tty then
|
|||||||
local b = 3
|
local b = 3
|
||||||
|
|
||||||
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
local id = vim.api.nvim_create_autocmd('TermResponse', {
|
||||||
|
group = group,
|
||||||
nested = true,
|
nested = true,
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local resp = args.data ---@type string
|
local resp = args.data ---@type string
|
||||||
|
Reference in New Issue
Block a user