From 4e371452e0100989f3489eac8cd20b336ebd403b Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Mon, 1 Aug 2022 23:06:23 +0200 Subject: chore: show in TSInstallInfo when parser is still loaded --- lua/nvim-treesitter/info.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua index bad0b4e60..eaeb9751c 100644 --- a/lua/nvim-treesitter/info.lua +++ b/lua/nvim-treesitter/info.lua @@ -14,11 +14,13 @@ local function install_info() local parser_list = parsers.available_parsers() table.sort(parser_list) - for _, ft in pairs(parser_list) do - local is_installed = #api.nvim_get_runtime_file("parser/" .. ft .. ".so", false) > 0 - api.nvim_out_write(ft .. string.rep(" ", max_len - #ft + 1)) + for _, lang in pairs(parser_list) do + local is_installed = #api.nvim_get_runtime_file("parser/" .. lang .. ".so", false) > 0 + api.nvim_out_write(lang .. string.rep(" ", max_len - #lang + 1)) if is_installed then api.nvim_out_write "[✓] installed\n" + elseif pcall(vim.treesitter.inspect_lang, lang) then + api.nvim_out_write "[✗] not installed (but still loaded. Restart Neovim!)\n" else api.nvim_out_write "[✗] not installed\n" end -- cgit v1.2.3-70-g09d2