mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(api): highlight attribute for underline
This commit fixes regression introduced in c365de1 when checking for
highlight attribute for underline was returning '0' when it was present
Fixes #17624.
			
			
This commit is contained in:
		| @@ -11411,7 +11411,7 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr) | |||||||
|   case 'u': { |   case 'u': { | ||||||
|     const size_t len = STRLEN(what); |     const size_t len = STRLEN(what); | ||||||
|     if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) {  // underline |     if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) {  // underline | ||||||
|       p = highlight_has_attr(id, HL_UNDERCURL, modec); |       p = highlight_has_attr(id, HL_UNDERLINE, modec); | ||||||
|     } else if (TOLOWER_ASC(what[5]) == 'c') {  // undercurl |     } else if (TOLOWER_ASC(what[5]) == 'c') {  // undercurl | ||||||
|        p = highlight_has_attr(id, HL_UNDERCURL, modec); |        p = highlight_has_attr(id, HL_UNDERCURL, modec); | ||||||
|     } else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') {  // underlineline |     } else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') {  // underlineline | ||||||
|   | |||||||
| @@ -305,10 +305,17 @@ describe('synIDattr()', function() | |||||||
|     eq('79', eval('synIDattr(hlID("Keyword"), "fg")')) |     eq('79', eval('synIDattr(hlID("Keyword"), "fg")')) | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|   it('returns "1" if group has "strikethrough" attribute', function() |   it('returns "1" if group has given highlight attribute', function() | ||||||
|     eq('', eval('synIDattr(hlID("Normal"), "strikethrough")')) |     local hl_attrs = { | ||||||
|     eq('1', eval('synIDattr(hlID("Keyword"), "strikethrough")')) |       'underline', 'underlineline', 'undercurl', 'underdot', 'underdash', 'strikethrough' | ||||||
|     eq('1', eval('synIDattr(hlID("Keyword"), "strikethrough", "gui")')) |     } | ||||||
|  |     for _,hl_attr in ipairs(hl_attrs) do | ||||||
|  |       local context = 'using ' .. hl_attr .. ' attr' | ||||||
|  |       command('highlight Keyword cterm=' .. hl_attr .. ' gui=' .. hl_attr) | ||||||
|  |       eq('', eval('synIDattr(hlID("Normal"), "'.. hl_attr .. '")'), context) | ||||||
|  |       eq('1', eval('synIDattr(hlID("Keyword"), "' .. hl_attr .. '")'), context) | ||||||
|  |       eq('1', eval('synIDattr(hlID("Keyword"), "' .. hl_attr .. '", "gui")'), context) | ||||||
|  |     end | ||||||
|   end) |   end) | ||||||
| end) | end) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kirill Chibisov
					Kirill Chibisov