aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/ui.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-10-15 21:16:27 +0300
committerZyX <kp-pav@yandex.ru>2017-10-15 21:16:27 +0300
commit76f0466536757fdc7306f92061017b8d51f0ef09 (patch)
treeaa6334c6afa44ed55c8b60ff869c59744efad993 /src/nvim/api/ui.c
parent3aa2c0d63ae488e302a89fdcdd650404cb2670fd (diff)
parent3e502fd7d67f01f8f8e3006da255d3fba40ee961 (diff)
downloadrneovim-76f0466536757fdc7306f92061017b8d51f0ef09.tar.gz
rneovim-76f0466536757fdc7306f92061017b8d51f0ef09.tar.bz2
rneovim-76f0466536757fdc7306f92061017b8d51f0ef09.zip
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r--src/nvim/api/ui.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 573be23d8e..afbee09c1c 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -215,6 +215,7 @@ static void ui_set_option(UI *ui, String name, Object value, Error *error)
#undef UI_EXT_OPTION
}
+/// Pushes data into UI.UIData, to be consumed later by remote_ui_flush().
static void push_call(UI *ui, char *name, Array args)
{
Array call = ARRAY_DICT_INIT;
@@ -241,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);