mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-patch:9.0.0111: "nocombine" is missing from synIDattr()
Problem: "nocombine" is missing from synIDattr().
Solution: Add "nocombine". (Munif Tanjim, closes vim/vim#10816)
de78632c41
This commit is contained in:

committed by
zeertzjq

parent
9511faa819
commit
29d5ca7d66
@@ -8041,6 +8041,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
|
||||
"underdotted" "1" if dotted underlined
|
||||
"underdashed" "1" if dashed underlined
|
||||
"strikethrough" "1" if struckthrough
|
||||
"nocombine" "1" if nocombine
|
||||
|
||||
Example (echoes the color of the syntax item under the
|
||||
cursor): >
|
||||
|
@@ -9498,8 +9498,12 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
p = highlight_has_attr(id, HL_ITALIC, modec);
|
||||
}
|
||||
break;
|
||||
case 'n': // name
|
||||
case 'n':
|
||||
if (TOLOWER_ASC(what[1]) == 'o') { // nocombine
|
||||
p = highlight_has_attr(id, HL_NOCOMBINE, modec);
|
||||
} else { // name
|
||||
p = get_highlight_name_ext(NULL, id - 1, false);
|
||||
}
|
||||
break;
|
||||
case 'r': // reverse
|
||||
p = highlight_has_attr(id, HL_INVERSE, modec);
|
||||
|
@@ -1,19 +1,39 @@
|
||||
" Test syntax highlighting functions.
|
||||
|
||||
func Test_missing_attr()
|
||||
hi Mine cterm=italic
|
||||
throw 'Skipped: use test/functional/legacy/syn_attr_spec.lua'
|
||||
|
||||
hi Mine term=bold cterm=italic
|
||||
call assert_equal('Mine', synIDattr(hlID("Mine"), "name"))
|
||||
call assert_equal('', synIDattr("Mine"->hlID(), "bg", 'term'))
|
||||
call assert_equal('', synIDattr("Mine"->hlID(), "fg", 'term'))
|
||||
call assert_equal('', synIDattr("Mine"->hlID(), "sp", 'term'))
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "bold", 'term'))
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "italic", 'cterm'))
|
||||
hi Mine cterm=inverse
|
||||
hi Mine term=reverse cterm=inverse
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "reverse", 'term'))
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm'))
|
||||
hi Mine cterm=standout gui=undercurl
|
||||
|
||||
hi Mine term=underline cterm=standout gui=undercurl
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "underline", 'term'))
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm'))
|
||||
call assert_equal('1', synIDattr("Mine"->hlID(), "undercurl", 'gui'))
|
||||
hi Mine gui=strikethrough
|
||||
|
||||
hi Mine term=underdouble cterm=underdotted gui=underdashed
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "underdouble", 'term'))
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "underdotted", 'cterm'))
|
||||
call assert_equal('1', synIDattr("Mine"->hlID(), "underdashed", 'gui'))
|
||||
|
||||
hi Mine term=nocombine gui=strikethrough
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "strikethrough", 'gui'))
|
||||
hi Mine cterm=NONE gui=NONE
|
||||
call assert_equal('1', synIDattr(hlID("Mine"), "nocombine", 'term'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "nocombine", 'gui'))
|
||||
hi Mine term=NONE cterm=NONE gui=NONE
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "bold", 'term'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "reverse", 'term'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "inverse", 'cterm'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "underline", 'term'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "standout", 'cterm'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui'))
|
||||
call assert_equal('', synIDattr(hlID("Mine"), "strikethrough", 'gui'))
|
||||
|
Reference in New Issue
Block a user