diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index 6fa4f2d6..a37670ea 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -11,25 +11,26 @@ return { -- Add Hyprland Parser { "luckasRanarison/tree-sitter-hyprlang", + dependencies = { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { + install_info = { + url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", + files = { "src/parser.c" }, + branch = "master", + }, + filetype = "hyprlang", + } + + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "hyprlang" }) + end, + }, enabled = function() return have("hypr") end, event = "BufRead */hypr/*.conf", - build = ":TSUpdate hypr", - config = function() - -- Fix ft detection for hyprland - vim.filetype.add({ - pattern = { [".*/hypr/.*%.conf"] = "hyprlang" }, - }) - require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { - install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", - files = { "src/parser.c" }, - branch = "master", - }, - filetype = "hypr", - } - end, }, -- add some stuff to treesitter