aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/ui.c
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-10-09 21:16:43 +0800
committerckelsel <ckelsel@hotmail.com>2017-10-09 21:16:43 +0800
commitceb40c0411843b35005f019bf2c61f22572afcdf (patch)
tree4c5d007be7419d1843effad71f5290918afec533 /src/nvim/api/ui.c
parent76606b6bc587fddcf990cf40a39521750734a80d (diff)
parentdb999821d45cb449df61a34bd241fde3fae0c609 (diff)
downloadrneovim-ceb40c0411843b35005f019bf2c61f22572afcdf.tar.gz
rneovim-ceb40c0411843b35005f019bf2c61f22572afcdf.tar.bz2
rneovim-ceb40c0411843b35005f019bf2c61f22572afcdf.zip
Merge remote-tracking branch 'upstream/master'
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);