From 1dffb1d853df39e2232fd39d3cf47ba3da2e8b6c Mon Sep 17 00:00:00 2001 From: Binh Duc Tran Date: Mon, 22 Jan 2024 13:49:45 +0700 Subject: [PATCH] fix(hyprlang): use lazyvim way to install (#2404) --- lua/lazyvim/plugins/extras/util/dot.lua | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) 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