summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/info.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-treesitter/info.lua')
-rw-r--r--lua/nvim-treesitter/info.lua33
1 files changed, 18 insertions, 15 deletions
diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua
index ed5a90b8..bad0b4e6 100644
--- a/lua/nvim-treesitter/info.lua
+++ b/lua/nvim-treesitter/info.lua
@@ -115,21 +115,24 @@ local function print_info_modules(parserlist, module)
api.nvim_buf_set_option(curbuf, "modified", false)
api.nvim_buf_set_option(curbuf, "buftype", "nofile")
- api.nvim_exec(
- [[
- syntax match TSModuleInfoGood /✓/
- syntax match TSModuleInfoBad /✗/
- syntax match TSModuleInfoHeader /^>>.*$/ contains=TSModuleInfoNamespace
- syntax match TSModuleInfoNamespace /^>> \w*/ contained
- syntax match TSModuleInfoParser /^[^> ]*\ze /
- highlight default TSModuleInfoGood guifg=LightGreen gui=bold
- highlight default TSModuleInfoBad guifg=Crimson
- highlight default link TSModuleInfoHeader Type
- highlight default link TSModuleInfoNamespace Statement
- highlight default link TSModuleInfoParser Identifier
- ]],
- false
- )
+ vim.cmd [[
+ syntax match TSModuleInfoGood /✓/
+ syntax match TSModuleInfoBad /✗/
+ syntax match TSModuleInfoHeader /^>>.*$/ contains=TSModuleInfoNamespace
+ syntax match TSModuleInfoNamespace /^>> \w*/ contained
+ syntax match TSModuleInfoParser /^[^> ]*\ze /
+ ]]
+
+ local highlights = {
+ TSModuleInfoGood = { fg = "LightGreen", bold = true, default = true },
+ TSModuleInfoBad = { fg = "Crimson", default = true },
+ TSModuleInfoHeader = { link = "Type", default = true },
+ TSModuleInfoNamespace = { link = "Statement", default = true },
+ TSModuleInfoParser = { link = "Identifier", default = true },
+ }
+ for k, v in pairs(highlights) do
+ api.nvim_set_hl(0, k, v)
+ end
end
local function module_info(module)