mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(extra-lang-angular): add BufNew event to attach angular treesitter (#3522)
## Problem Sometimes angular treesitter didn't get started, e.g. when creating a new file. ## Solution - Add `BufNew` event to attach angular treesitter. - Change `BufRead` to `BufReadPost` for better readability. ### Related Neovim docs - [BufRead / BufReadPost docs](https://neovim.io/doc/user/autocmd.html#BufRead) - [BufNew](https://neovim.io/doc/user/autocmd.html#BufNew)
This commit is contained in:
parent
51854046db
commit
fbb1276ffd
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ return {
|
|||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "angular", "scss" })
|
||||
end
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||
pattern = { "*.component.html", "*.container.html" },
|
||||
callback = function()
|
||||
vim.treesitter.start(nil, "angular")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue