File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,14 @@ local function setup_highlight_groups()
5
5
vim .api .nvim_set_hl (0 , " CodeownersComment" , { link = " Comment" })
6
6
vim .api .nvim_set_hl (0 , " CodeownersPath" , { link = " Identifier" })
7
7
vim .api .nvim_set_hl (0 , " CodeownersGlobalPath" , { link = " Special" })
8
- vim .api .nvim_set_hl (0 , " CodeownersOwner" , { link = " String" })
9
- vim .api .nvim_set_hl (0 , " CodeownersEmail" , { link = " Constant" })
8
+
9
+ -- Try to use treesitter highlight groups for better theming
10
+ local has_treesitter = pcall (require , ' nvim-treesitter' )
11
+ if has_treesitter and vim .fn .hlexists (" @string.special" ) == 1 then
12
+ vim .api .nvim_set_hl (0 , " CodeownersOwner" , { link = " @string.special" })
13
+ else
14
+ vim .api .nvim_set_hl (0 , " CodeownersOwner" , { link = " String" })
15
+ end
10
16
end
11
17
12
18
local function highlight_line (bufnr , line_num , line_content )
You can’t perform that action at this time.
0 commit comments