aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/ui.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-10-08 19:09:14 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-10-08 19:09:14 +0200
commit04187a1c74e79abfb46c0b9c1e522b61f1cedcae (patch)
treeae13c45333d1fb47e1734f59d3625139d69a8161 /src/nvim/api/ui.c
parent032b088c848585e60e8dc1a210f240bad6bb3387 (diff)
parent481e40cc8ca061f5c3a68f56f30ee96e9086da4d (diff)
downloadrneovim-04187a1c74e79abfb46c0b9c1e522b61f1cedcae.tar.gz
rneovim-04187a1c74e79abfb46c0b9c1e522b61f1cedcae.tar.bz2
rneovim-04187a1c74e79abfb46c0b9c1e522b61f1cedcae.zip
Merge #7082 'api: nvim_get_hl_by_name/by_id'
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r--src/nvim/api/ui.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index bbbd5ab2dc..afbee09c1c 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -242,39 +242,7 @@ static void push_call(UI *ui, char *name, Array args)
static void remote_ui_highlight_set(UI *ui, HlAttrs attrs)
{
Array args = ARRAY_DICT_INIT;
- Dictionary hl = ARRAY_DICT_INIT;
-
- if (attrs.bold) {
- PUT(hl, "bold", BOOLEAN_OBJ(true));
- }
-
- if (attrs.underline) {
- PUT(hl, "underline", BOOLEAN_OBJ(true));
- }
-
- if (attrs.undercurl) {
- PUT(hl, "undercurl", BOOLEAN_OBJ(true));
- }
-
- if (attrs.italic) {
- PUT(hl, "italic", BOOLEAN_OBJ(true));
- }
-
- if (attrs.reverse) {
- PUT(hl, "reverse", BOOLEAN_OBJ(true));
- }
-
- if (attrs.foreground != -1) {
- PUT(hl, "foreground", INTEGER_OBJ(attrs.foreground));
- }
-
- if (attrs.background != -1) {
- PUT(hl, "background", INTEGER_OBJ(attrs.background));
- }
-
- if (attrs.special != -1) {
- PUT(hl, "special", INTEGER_OBJ(attrs.special));
- }
+ Dictionary hl = hlattrs2dict(attrs);
ADD(args, DICTIONARY_OBJ(hl));
push_call(ui, "highlight_set", args);