This commit is contained in:
Jaehwang Jung 2024-12-18 11:15:28 +01:00 committed by GitHub
commit 0905c34291
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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)