-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nvim-ts-rainbow(2)): move autocmd to dependencies
- Loading branch information
1 parent
cd37ef6
commit df1aff6
Showing
2 changed files
with
24 additions
and
22 deletions.
There are no files selected for viewing
23 changes: 12 additions & 11 deletions
23
lua/astrocommunity/editing-support/nvim-ts-rainbow/nvim-ts-rainbow.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
23 changes: 12 additions & 11 deletions
23
lua/astrocommunity/editing-support/nvim-ts-rainbow2/nvim-ts-rainbow2.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |