fix(treesitter): update @markup default links

* use `Special` as default for `@markup.*`, especially `@markup.raw` and
  `@markup.math` (`@markup` itself is never used)
* use `Structure` for `@markup.environment`
* highlight all of `@markup.link` as Underlined (otherwise concealed
  links are invisible)
This commit is contained in:
Christian Clason
2024-01-21 11:13:11 +01:00
parent d3fa8adea9
commit 26143d7a5c
2 changed files with 17 additions and 23 deletions

View File

@@ -302,17 +302,10 @@ static const char *highlight_init_both[] = {
"@markup.strikethrough gui=strikethrough, cterm=strikethrough", "@markup.strikethrough gui=strikethrough, cterm=strikethrough",
"@markup.underline gui=underline, cterm=underline", "@markup.underline gui=underline, cterm=underline",
"default link @markup.heading Title", "default link @markup Special", // fallback for subgroups; never used itself
"default link @markup.heading Title",
"default link @markup.raw Comment", "default link @markup.environment Structure",
"default link @markup.quote Comment", "default link @markup.link Underlined",
"default link @markup.math Comment",
"default link @markup.environment Comment",
"default link @markup.link Underlined",
"default link @markup.link.label Identifier",
"default link @markup.list Special",
"default link @markup.list.checked DiagnosticOk", "default link @markup.list.checked DiagnosticOk",
"default link @markup.list.unchecked DiagnosticWarn", "default link @markup.list.unchecked DiagnosticWarn",

View File

@@ -745,6 +745,7 @@ describe('treesitter highlighting (help)', function()
[3] = { bold = true, foreground = Screen.colors.Brown }, [3] = { bold = true, foreground = Screen.colors.Brown },
[4] = { foreground = Screen.colors.Cyan4 }, [4] = { foreground = Screen.colors.Cyan4 },
[5] = { foreground = Screen.colors.Magenta1 }, [5] = { foreground = Screen.colors.Magenta1 },
[6] = { foreground = Screen.colors.SlateBlue },
} }
end) end)
@@ -763,10 +764,10 @@ describe('treesitter highlighting (help)', function()
screen:expect { screen:expect {
grid = [[ grid = [[
{1:>ruby} | {6:>ruby} |
{1: -- comment} | {6: -- comment} |
{1: local this_is = 'actually_lua'} | {6: local this_is = 'actually_lua'} |
{1:<} | {6:<} |
^ | ^ |
| |
]], ]],
@@ -776,10 +777,10 @@ describe('treesitter highlighting (help)', function()
screen:expect { screen:expect {
grid = [[ grid = [[
{1:>lua} | {6:>lua} |
{1: -- comment} | {6: }{1:-- comment} |
{1: }{3:local}{1: }{4:this_is}{1: }{3:=}{1: }{5:'actually_lua'} | {6: }{3:local}{6: }{4:this_is}{6: }{3:=}{6: }{5:'actually_lua'} |
{1:<} | {6:<} |
^ | ^ |
| |
]], ]],
@@ -789,10 +790,10 @@ describe('treesitter highlighting (help)', function()
screen:expect { screen:expect {
grid = [[ grid = [[
{1:>ruby} | {6:>ruby} |
{1: -- comment} | {6: -- comment} |
{1: local this_is = 'actually_lua'} | {6: local this_is = 'actually_lua'} |
{1:<} | {6:<} |
^ | ^ |
| |
]], ]],