diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2022-04-16 17:49:17 +0200 |
|---|---|---|
| committer | Christian Clason <christian.clason@uni-due.de> | 2022-04-30 16:08:01 +0200 |
| commit | 07eb437bb1c4c0a0298553dd509294f82362d6bc (patch) | |
| tree | 14dace08a1b7b3a1cb335fe8fc30497820c9e02f /lua/nvim-treesitter/info.lua | |
| parent | bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398 (diff) | |
refactor!: update to Neovim 0.7 APIs
* set highlight groups via nvim_set_hl
* define autocommands via nvim_create_autocmd
* port plugin/nvim-treesitter.vim to Lua
* port healthcheck to Lua
Diffstat (limited to 'lua/nvim-treesitter/info.lua')
| -rw-r--r-- | lua/nvim-treesitter/info.lua | 33 |
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) |
