From 1724a6e2593dad92dadc766a575c8e4a66f52b87 Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Tue, 5 Nov 2024 01:55:59 +0900 Subject: [PATCH] fix(editorconfig): rename augroup Problem: Builtin editorconfig plugin's augroup name conflicts with https://github.com/editorconfig/editorconfig-vim, overriding that plugin. Solution: Rename the augroup. --- runtime/lua/editorconfig.lua | 6 +++--- runtime/plugin/editorconfig.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/lua/editorconfig.lua b/runtime/lua/editorconfig.lua index e65d267a70..25e9f3e6d8 100644 --- a/runtime/lua/editorconfig.lua +++ b/runtime/lua/editorconfig.lua @@ -151,7 +151,7 @@ function properties.trim_trailing_whitespace(bufnr, val) ) if val == 'true' then vim.api.nvim_create_autocmd('BufWritePre', { - group = 'editorconfig', + group = 'nvim_editorconfig', buffer = bufnr, callback = function() local view = vim.fn.winsaveview() @@ -163,7 +163,7 @@ function properties.trim_trailing_whitespace(bufnr, val) else vim.api.nvim_clear_autocmds({ event = 'BufWritePre', - group = 'editorconfig', + group = 'nvim_editorconfig', buffer = bufnr, }) end @@ -180,7 +180,7 @@ function properties.insert_final_newline(bufnr, val) local endofline = val == 'true' if vim.bo[bufnr].endofline ~= endofline then vim.api.nvim_create_autocmd('BufWritePre', { - group = 'editorconfig', + group = 'nvim_editorconfig', buffer = bufnr, once = true, callback = function() diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index a96919e1fe..36fac338c8 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -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' }, { group = group, callback = function(args)