diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-10-08 19:09:14 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-10-08 19:09:14 +0200 |
commit | 04187a1c74e79abfb46c0b9c1e522b61f1cedcae (patch) | |
tree | ae13c45333d1fb47e1734f59d3625139d69a8161 /src/nvim/api/ui.c | |
parent | 032b088c848585e60e8dc1a210f240bad6bb3387 (diff) | |
parent | 481e40cc8ca061f5c3a68f56f30ee96e9086da4d (diff) | |
download | rneovim-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.c | 34 |
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); |