Changed prototypes to accept a boolean "rgb"

This commit is contained in:
Matthieu Coudron
2017-09-03 05:25:57 +02:00
parent e3a2cca387
commit 3a00648639
3 changed files with 17 additions and 17 deletions

View File

@@ -59,9 +59,10 @@ void nvim_command(String command, Error *err)
/// Retrieves highlight description from its name
///
/// @param name Highlight group name
/// @param rgb True to export GUI values
/// @return a highlight description e.g. {'bold': true, 'bg': 123, 'fg': 42}
/// @see nvim_get_hl_by_id
Dictionary nvim_get_hl_by_name(String name, Error *err)
Dictionary nvim_get_hl_by_name(String name, Boolean rgb, Error *err)
FUNC_API_SINCE(3)
{
Dictionary result = ARRAY_DICT_INIT;
@@ -72,15 +73,16 @@ Dictionary nvim_get_hl_by_name(String name, Error *err)
name.data);
return result;
}
result = nvim_get_hl_by_id(id, err);
result = nvim_get_hl_by_id(id, rgb, err);
return result;
}
/// Retrieves highlight description from its id
///
/// @param hl_id highlight id as returned by |hlID()|
/// @param rgb True to export GUI values
/// @see nvim_get_hl_by_name
Dictionary nvim_get_hl_by_id(Integer hl_id, Error *err)
Dictionary nvim_get_hl_by_id(Integer hl_id, Boolean rgb, Error *err)
FUNC_API_SINCE(3)
{
Dictionary dic = ARRAY_DICT_INIT;
@@ -89,7 +91,7 @@ Dictionary nvim_get_hl_by_id(Integer hl_id, Error *err)
return dic;
}
int attrcode = syn_id2attr((int)hl_id);
return hl_get_attr_by_id(attrcode, err);
return hl_get_attr_by_id(attrcode, rgb, err);
}
/// Passes input keys to Nvim.

View File

@@ -8224,7 +8224,7 @@ RgbValue name_to_color(const uint8_t *name)
/// Retrieves attribute description from its id
///
/// @param attr_id attribute id
Dictionary hl_get_attr_by_id(Integer attr_id, Error *err)
Dictionary hl_get_attr_by_id(Integer attr_id, Boolean rgb, Error *err)
{
HlAttrs attrs = HLATTRS_INIT;
Dictionary dic = ARRAY_DICT_INIT;
@@ -8240,7 +8240,7 @@ Dictionary hl_get_attr_by_id(Integer attr_id, Error *err)
return dic;
}
attrs = attrentry2hlattrs(aep, p_tgc);
attrs = attrentry2hlattrs(aep, rgb);
end:
return hlattrs2dict(attrs);