forked from aniani/vim
patch 8.2.4942: error when setting 'filetype' in help file again
Problem: Error when setting 'filetype' in help file again. Solution: Deal with text property type already existing. (closes #10409)
This commit is contained in:
6
runtime/import/dist/vimhelp.vim
vendored
6
runtime/import/dist/vimhelp.vim
vendored
@@ -9,11 +9,17 @@ export def HighlightGroups()
|
||||
while getline(lnum) !~ '===' && lnum < line('$')
|
||||
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
|
||||
# was called before, delete existing properties
|
||||
prop_remove({type: name, bufnr: buf})
|
||||
endif
|
||||
prop_add(lnum, 1, {length: word->strlen(), type: 'help-hl-' .. word})
|
||||
endif
|
||||
++lnum
|
||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
4942,
|
||||
/**/
|
||||
4941,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user