diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-12 22:15:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-12 22:15:57 +0100 |
commit | 6ba83ba9ee292f68aa0b218b3eef42db31c0b632 (patch) | |
tree | 9aeb2595f8856396b03ce3314303424459bfa204 /runtime/import | |
parent | a7ac4c9c395d64059437e37045fa0ad5f9fecb0b (diff) |
Update runtime files.
Diffstat (limited to 'runtime/import')
-rw-r--r-- | runtime/import/dist/vimhelp.vim | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/runtime/import/dist/vimhelp.vim b/runtime/import/dist/vimhelp.vim index e0afd1f97d..d053f63041 100644 --- a/runtime/import/dist/vimhelp.vim +++ b/runtime/import/dist/vimhelp.vim @@ -4,24 +4,28 @@ vim9script # Called when editing the doc/syntax.txt file export def HighlightGroups() + var save_cursor = getcurpos() var buf: number = bufnr('%') - var lnum: number = search('\*highlight-groups\*', 'cn') - while getline(lnum) !~ '===' && lnum < line('$') - var word: string = getline(lnum)->matchstr('^\w\+\ze\s') + + var start: number = search('\*highlight-groups\*', 'c') + var end: number = search('^======') + for lnum in range(start, end) + var word: string = getline(lnum)->matchstr('^\w\+\ze\t') if word->hlexists() - var name = 'help-hl-' .. word - if prop_type_list({bufnr: buf})->match(name) == -1 - prop_type_add('help-hl-' .. word, { - bufnr: buf, - highlight: word, - combine: false, - }) - else + var type = 'help-hl-' .. word + if prop_type_list({bufnr: buf})->index(type) != -1 # was called before, delete existing properties - prop_remove({type: name, bufnr: buf}) + prop_remove({type: type, bufnr: buf}) + prop_type_delete(type, {bufnr: buf}) endif - prop_add(lnum, 1, {length: word->strlen(), type: 'help-hl-' .. word}) + prop_type_add(type, { + bufnr: buf, + highlight: word, + combine: false, + }) + prop_add(lnum, 1, {length: word->strlen(), type: type}) endif - ++lnum - endwhile + endfor + + setpos('.', save_cursor) enddef |