fix: create only one autocmd for sidebars
This commit is contained in:
parent
3271d5d4ab
commit
63e24b3565
@ -81,12 +81,14 @@ function M.autocmds(config)
|
|||||||
vim.cmd([[augroup TokyoNight]])
|
vim.cmd([[augroup TokyoNight]])
|
||||||
vim.cmd([[ autocmd!]])
|
vim.cmd([[ autocmd!]])
|
||||||
vim.cmd([[ autocmd ColorScheme * lua require("tokyonight.util").onColorScheme()]])
|
vim.cmd([[ autocmd ColorScheme * lua require("tokyonight.util").onColorScheme()]])
|
||||||
for _, sidebar in ipairs(config.sidebars) do
|
|
||||||
if sidebar == "terminal" then
|
vim.cmd(
|
||||||
vim.cmd([[ autocmd TermOpen * setlocal winhighlight=Normal:NormalSB,SignColumn:SignColumnSB]])
|
[[ autocmd FileType ]]
|
||||||
else
|
.. table.concat(config.sidebars, ",")
|
||||||
vim.cmd([[ autocmd FileType ]] .. sidebar .. [[ setlocal winhighlight=Normal:NormalSB,SignColumn:SignColumnSB]])
|
.. [[ setlocal winhighlight=Normal:NormalSB,SignColumn:SignColumnSB]]
|
||||||
end
|
)
|
||||||
|
if vim.tbl_contains(config.sidebars, "terminal") then
|
||||||
|
vim.cmd([[ autocmd TermOpen * setlocal winhighlight=Normal:NormalSB,SignColumn:SignColumnSB]])
|
||||||
end
|
end
|
||||||
vim.cmd([[augroup end]])
|
vim.cmd([[augroup end]])
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user