From 2c1888e94705d5d5bf1e7694270536166a2f5569 Mon Sep 17 00:00:00 2001 From: Shadman Date: Mon, 11 Jan 2021 08:40:09 +0600 Subject: [PATCH] Putting autocomands in a group (#59) * Warp autocmd with augroup --- lua/lualine.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lualine.lua b/lua/lualine.lua index 9e09085..89be952 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -109,9 +109,12 @@ end local function exec_autocommands() _G.set_lualine_theme = set_lualine_theme _G.set_active_statusline = statusline + vim.cmd([[augroup lualine]]) + vim.cmd([[autocmd!]]) vim.cmd([[autocmd WinEnter,BufEnter * setlocal statusline=%!v:lua.set_active_statusline(1)]]) vim.cmd([[autocmd WinLeave,BufLeave * lua require('lualine').set_inactive_statusline()]]) vim.cmd([[autocmd ColorScheme * call v:lua.set_lualine_theme()]]) + vim.cmd([[augroup END]]) end function M.status()