0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

patch 8.2.4891: Vim help presentation could be better

Problem:    Vim help presentation could be better.
Solution:   Add an imported file for extra Vim help support.  Show highlight
            names in the color they have.
This commit is contained in:
Bram Moolenaar 2022-05-06 16:32:46 +01:00
parent cf030578b2
commit b3c9077a5b
3 changed files with 24 additions and 0 deletions

View File

@ -722,6 +722,7 @@ RT_ALL = \
runtime/doc/xxd.1 \
runtime/ftoff.vim \
runtime/gvimrc_example.vim \
runtime/import/dist/vimhelp.vim \
runtime/macros/README.txt \
runtime/macros/editexisting.vim \
runtime/macros/hanoi/click.me \

21
runtime/import/dist/vimhelp.vim vendored Normal file
View File

@ -0,0 +1,21 @@
vim9script
# Extra functionality for displaying Vim help .
# Called when editing the doc/syntax.txt file
export def HighlightGroups()
var buf: number = bufnr('%')
var lnum: number = search('\*highlight-groups\*', 'cn')
while getline(lnum) !~ '===' && lnum < line('$')
var word: string = getline(lnum)->matchstr('^\w\+\ze\t')
if word->hlexists()
prop_type_add('help-hl-' .. word, {
bufnr: buf,
highlight: word,
combine: false,
})
prop_add(lnum, 1, {length: word->strlen(), type: 'help-hl-' .. word})
endif
++lnum
endwhile
enddef

View File

@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4891,
/**/
4890,
/**/