Skip to content

Commit

Permalink
fix(nvim-ts-rainbow(2)): move autocmd to dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshgupta137 authored and mehalter committed Mar 17, 2023
1 parent cd37ef6 commit df1aff6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = { "mrjones2014/nvim-ts-rainbow" },
dependencies = {
"mrjones2014/nvim-ts-rainbow",
config = function()
-- HACK: https://github.com/p00f/nvim-ts-rainbow/issues/112#issuecomment-1310835936
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained" }, {
callback = function()
vim.cmd "TSDisable rainbow"
vim.cmd "TSEnable rainbow"
end,
})
end,
},
opts = { rainbow = { enable = true } },
config = function(_, opts)
-- HACK: https://github.com/p00f/nvim-ts-rainbow/issues/112#issuecomment-1310835936
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained" }, {
callback = function()
vim.cmd "TSDisable rainbow"
vim.cmd "TSEnable rainbow"
end,
})
require("nvim-treesitter.configs").setup(opts)
end,
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
return {
"nvim-treesitter/nvim-treesitter",
dependencies = { "HiPhish/nvim-ts-rainbow2" },
dependencies = {
"HiPhish/nvim-ts-rainbow2",
config = function()
-- HACK: https://github.com/p00f/nvim-ts-rainbow/issues/112#issuecomment-1310835936
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained" }, {
callback = function()
vim.cmd "TSDisable rainbow"
vim.cmd "TSEnable rainbow"
end,
})
end,
},
opts = { rainbow = { enable = true } },
config = function(_, opts)
-- HACK: https://github.com/p00f/nvim-ts-rainbow/issues/112#issuecomment-1310835936
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained" }, {
callback = function()
vim.cmd "TSDisable rainbow"
vim.cmd "TSEnable rainbow"
end,
})
require("nvim-treesitter.configs").setup(opts)
end,
}

0 comments on commit df1aff6

Please sign in to comment.