mirror of
https://github.com/neovim/neovim.git
synced 2026-02-07 04:52:04 +10:00
feat(defaults): pretty :help headings #30544
Problem: Headings in :help do not stand out visually. Solution: Define a non-standard `@markup.heading.1.delimiter` group and special-case it in `highlight_group.c`. FUTURE: This is a cheap workaround until we have #25718 which will enable: - fully driven by `vimdoc/highlights.scm` instead of using highlight tricks (`guibg=bg guifg=bg guisp=fg`) - better support of "cterm" ('notermguicolors')
This commit is contained in:
@@ -894,9 +894,45 @@ describe('treesitter highlighting (help)', function()
|
||||
[3] = { bold = true, foreground = Screen.colors.Brown },
|
||||
[4] = { foreground = Screen.colors.Cyan4 },
|
||||
[5] = { foreground = Screen.colors.Magenta1 },
|
||||
title = { bold = true, foreground = Screen.colors.Magenta1 },
|
||||
h1_delim = { nocombine = true, underdouble = true },
|
||||
h2_delim = { nocombine = true, underline = true },
|
||||
}
|
||||
end)
|
||||
|
||||
it('defaults in vimdoc/highlights.scm', function()
|
||||
-- Avoid regressions when syncing upstream vimdoc queries.
|
||||
|
||||
insert [[
|
||||
==============================================================================
|
||||
NVIM DOCUMENTATION
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
ABOUT NVIM *tag-1* *tag-2*
|
||||
|
||||
|news| News
|
||||
|nvim| NVim
|
||||
]]
|
||||
|
||||
feed('gg')
|
||||
exec_lua(function()
|
||||
vim.wo.wrap = false
|
||||
vim.bo.filetype = 'help'
|
||||
vim.treesitter.start()
|
||||
end)
|
||||
|
||||
screen:expect({
|
||||
grid = [[
|
||||
{h1_delim:^========================================}|
|
||||
{title:NVIM DOCUMENTATION} |
|
||||
|
|
||||
{h2_delim:----------------------------------------}|
|
||||
{title:ABOUT NVIM} |
|
||||
|
|
||||
]],
|
||||
})
|
||||
end)
|
||||
|
||||
it('correctly redraws added/removed injections', function()
|
||||
insert [[
|
||||
>ruby
|
||||
|
||||
Reference in New Issue
Block a user