diff options
| author | Marco Hinz <mh.codebro@gmail.com> | 2021-03-26 01:35:24 +0100 |
|---|---|---|
| committer | Marco Hinz <mh.codebro@gmail.com> | 2021-03-26 01:37:27 +0100 |
| commit | 95f99383be8604ae3d31fe57d326ccba336304d8 (patch) | |
| tree | 6d7906cb7f49cb7204967b379d1157ebde7a8c3e /lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar.gz nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar.bz2 nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar.lz nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar.xz nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.tar.zst nvim-lspconfig-95f99383be8604ae3d31fe57d326ccba336304d8.zip | |
lspinfo: avoid overeager highlighting
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/lspinfo.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/lspconfig/lspinfo.lua b/lua/lspconfig/lspinfo.lua index b94ac319..958b27ae 100644 --- a/lua/lspconfig/lspinfo.lua +++ b/lua/lspconfig/lspinfo.lua @@ -121,8 +121,9 @@ return function () vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, buf_lines ) vim.api.nvim_buf_set_option(bufnr,'modifiable',false) vim.api.nvim_buf_set_option(bufnr,'filetype','lspinfo') - vim.fn.matchadd("Title", table.concat(vim.tbl_keys(configs), '\\|')) - vim.fn.matchadd("Title", buffer_filetype) + local configs_pattern = '\\%(' .. table.concat(vim.tbl_keys(configs), '\\|') .. '\\)' + vim.cmd('syntax match Title /\\%(Client\\|Config\\):.*\\zs' .. configs_pattern .. '/') + vim.cmd('syntax match Identifier /filetypes:.*\\zs\\<' .. buffer_filetype .. '\\>/') vim.fn.matchadd("Error", "No filetypes defined, please define filetypes in setup().\\|".. "cmd not defined\\|" .. |
