mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	feat(api): add strikethrough, nocombine to set_hl
This commit is contained in:
		| @@ -81,10 +81,12 @@ return { | |||||||
|   highlight = { |   highlight = { | ||||||
|     "bold"; |     "bold"; | ||||||
|     "standout"; |     "standout"; | ||||||
|  |     "strikethrough"; | ||||||
|     "underline"; |     "underline"; | ||||||
|     "undercurl"; |     "undercurl"; | ||||||
|     "italic"; |     "italic"; | ||||||
|     "reverse"; |     "reverse"; | ||||||
|  |     "nocombine"; | ||||||
|     "default"; |     "default"; | ||||||
|     "global"; |     "global"; | ||||||
|     "cterm"; |     "cterm"; | ||||||
| @@ -100,10 +102,12 @@ return { | |||||||
|   highlight_cterm = { |   highlight_cterm = { | ||||||
|     "bold"; |     "bold"; | ||||||
|     "standout"; |     "standout"; | ||||||
|  |     "strikethrough"; | ||||||
|     "underline"; |     "underline"; | ||||||
|     "undercurl"; |     "undercurl"; | ||||||
|     "italic"; |     "italic"; | ||||||
|     "reverse"; |     "reverse"; | ||||||
|  |     "nocombine"; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -815,6 +815,8 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e | |||||||
|   CHECK_FLAG(dict, mask, undercurl, , HL_UNDERCURL); |   CHECK_FLAG(dict, mask, undercurl, , HL_UNDERCURL); | ||||||
|   CHECK_FLAG(dict, mask, italic, , HL_ITALIC); |   CHECK_FLAG(dict, mask, italic, , HL_ITALIC); | ||||||
|   CHECK_FLAG(dict, mask, reverse, , HL_INVERSE); |   CHECK_FLAG(dict, mask, reverse, , HL_INVERSE); | ||||||
|  |   CHECK_FLAG(dict, mask, strikethrough, , HL_STRIKETHROUGH); | ||||||
|  |   CHECK_FLAG(dict, mask, nocombine, , HL_NOCOMBINE); | ||||||
|   CHECK_FLAG(dict, mask, default, _, HL_DEFAULT); |   CHECK_FLAG(dict, mask, default, _, HL_DEFAULT); | ||||||
|   CHECK_FLAG(dict, mask, global, , HL_GLOBAL); |   CHECK_FLAG(dict, mask, global, , HL_GLOBAL); | ||||||
|  |  | ||||||
| @@ -871,6 +873,8 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e | |||||||
|     CHECK_FLAG(cterm, cterm_mask, undercurl, , HL_UNDERCURL); |     CHECK_FLAG(cterm, cterm_mask, undercurl, , HL_UNDERCURL); | ||||||
|     CHECK_FLAG(cterm, cterm_mask, italic, , HL_ITALIC); |     CHECK_FLAG(cterm, cterm_mask, italic, , HL_ITALIC); | ||||||
|     CHECK_FLAG(cterm, cterm_mask, reverse, , HL_INVERSE); |     CHECK_FLAG(cterm, cterm_mask, reverse, , HL_INVERSE); | ||||||
|  |     CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH); | ||||||
|  |     CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE); | ||||||
|  |  | ||||||
|   } else if (HAS_KEY(dict->cterm)) { |   } else if (HAS_KEY(dict->cterm)) { | ||||||
|     api_set_error(err, kErrorTypeValidation, "'cterm' must be a Dictionary."); |     api_set_error(err, kErrorTypeValidation, "'cterm' must be a Dictionary."); | ||||||
|   | |||||||
| @@ -195,10 +195,12 @@ describe("API: set highlight", function() | |||||||
|     reverse = true, |     reverse = true, | ||||||
|     undercurl = true, |     undercurl = true, | ||||||
|     underline = true, |     underline = true, | ||||||
|  |     strikethrough = true, | ||||||
|     cterm = { |     cterm = { | ||||||
|       italic = true, |       italic = true, | ||||||
|       reverse = true, |       reverse = true, | ||||||
|       undercurl = true, |       undercurl = true, | ||||||
|  |       strikethrough = true, | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   local highlight3_result_gui = { |   local highlight3_result_gui = { | ||||||
| @@ -209,6 +211,7 @@ describe("API: set highlight", function() | |||||||
|     reverse = true, |     reverse = true, | ||||||
|     undercurl = true, |     undercurl = true, | ||||||
|     underline = true, |     underline = true, | ||||||
|  |     strikethrough = true, | ||||||
|   } |   } | ||||||
|   local highlight3_result_cterm = { |   local highlight3_result_cterm = { | ||||||
|     background = highlight_color.ctermbg, |     background = highlight_color.ctermbg, | ||||||
| @@ -216,6 +219,7 @@ describe("API: set highlight", function() | |||||||
|     italic = true, |     italic = true, | ||||||
|     reverse = true, |     reverse = true, | ||||||
|     undercurl = true, |     undercurl = true, | ||||||
|  |     strikethrough = true, | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   local function get_ns() |   local function get_ns() | ||||||
| @@ -264,7 +268,7 @@ describe("API: set highlight", function() | |||||||
|       exec_capture('highlight Test_hl')) |       exec_capture('highlight Test_hl')) | ||||||
|  |  | ||||||
|     meths.set_hl(0, 'Test_hl2', highlight3_config) |     meths.set_hl(0, 'Test_hl2', highlight3_config) | ||||||
|     eq('Test_hl2       xxx cterm=undercurl,italic,reverse ctermfg=8 ctermbg=15 gui=bold,underline,undercurl,italic,reverse guifg=#ff0000 guibg=#0032aa', |     eq('Test_hl2       xxx cterm=undercurl,italic,reverse,strikethrough ctermfg=8 ctermbg=15 gui=bold,underline,undercurl,italic,reverse,strikethrough guifg=#ff0000 guibg=#0032aa', | ||||||
|       exec_capture('highlight Test_hl2')) |       exec_capture('highlight Test_hl2')) | ||||||
|  |  | ||||||
|     -- Colors are stored exactly as they are defined. |     -- Colors are stored exactly as they are defined. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Christian Clason
					Christian Clason