From 95f99383be8604ae3d31fe57d326ccba336304d8 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 26 Mar 2021 01:35:24 +0100 Subject: lspinfo: avoid overeager highlighting --- lua/lspconfig/lspinfo.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua') 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\\|" .. -- cgit v1.2.3-70-g09d2