A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/b5bf4877c0239767c1095e4567e67c222bea38a0 below:

support for blend in nvim_set_hl (#17516) · neovim/neovim@b5bf487 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+21

-0

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+21

-0

lines changed Original file line number Diff line number Diff line change

@@ -97,6 +97,7 @@ return {

97 97

"special"; "sp";

98 98

"link";

99 99

"fallback";

100 +

"blend";

100 101

"temp";

101 102

};

102 103

highlight_cterm = {

Original file line number Diff line number Diff line change

@@ -800,6 +800,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e

800 800

{

801 801

HlAttrs hlattrs = HLATTRS_INIT;

802 802

int32_t fg = -1, bg = -1, ctermfg = -1, ctermbg = -1, sp = -1;

803 +

int blend = -1;

803 804

int16_t mask = 0;

804 805

int16_t cterm_mask = 0;

805 806

bool cterm_mask_provided = false;

@@ -847,6 +848,20 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e

847 848

return hlattrs;

848 849

}

849 850 851 +

if (dict->blend.type == kObjectTypeInteger) {

852 +

Integer blend0 = dict->blend.data.integer;

853 +

if (blend0 < 0 || blend0 > 100) {

854 +

api_set_error(err, kErrorTypeValidation, "'blend' is not between 0 to 100");

855 +

} else {

856 +

blend = (int)blend0;

857 +

}

858 +

} else if (HAS_KEY(dict->blend)) {

859 +

api_set_error(err, kErrorTypeValidation, "'blend' must be an integer");

860 +

}

861 +

if (ERROR_SET(err)) {

862 +

return hlattrs;

863 +

}

864 + 850 865

if (HAS_KEY(dict->link)) {

851 866

if (link_id) {

852 867

*link_id = object_to_hl_id(dict->link, "link", err);

@@ -908,6 +923,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e

908 923

hlattrs.rgb_bg_color = bg;

909 924

hlattrs.rgb_fg_color = fg;

910 925

hlattrs.rgb_sp_color = sp;

926 +

hlattrs.hl_blend = blend;

911 927

hlattrs.cterm_bg_color = ctermbg == -1 ? 0 : ctermbg + 1;

912 928

hlattrs.cterm_fg_color = ctermfg == -1 ? 0 : ctermfg + 1;

913 929

hlattrs.cterm_ae_attr = cterm_mask;

Original file line number Diff line number Diff line change

@@ -323,5 +323,9 @@ describe("API: set highlight", function()

323 323

exec_capture('highlight Test_hl3'))

324 324

end

325 325 326 +

meths.set_hl(0, 'Test_hl3', {fg='#FF00FF', blend=50})

327 +

eq('Test_hl3 xxx guifg=#FF00FF blend=50',

328 +

exec_capture('highlight Test_hl3'))

329 + 326 330

end)

327 331

end)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4