ui: Merge standout and reverse into one attribute

This commit is contained in:
Thiago de Arruda
2014-12-30 08:24:22 -03:00
parent 0219c87534
commit 0887c5446e
3 changed files with 3 additions and 8 deletions

View File

@@ -249,10 +249,6 @@ static void remote_ui_highlight_set(UI *ui, HlAttrs attrs)
PUT(hl, "bold", BOOLEAN_OBJ(true)); PUT(hl, "bold", BOOLEAN_OBJ(true));
} }
if (attrs.standout) {
PUT(hl, "standout", BOOLEAN_OBJ(true));
}
if (attrs.underline) { if (attrs.underline) {
PUT(hl, "underline", BOOLEAN_OBJ(true)); PUT(hl, "underline", BOOLEAN_OBJ(true));
} }

View File

@@ -61,7 +61,7 @@ static struct {
} sr; } sr;
static int current_highlight_mask = 0; static int current_highlight_mask = 0;
static HlAttrs current_attrs = { static HlAttrs current_attrs = {
false, false, false, false, false, false, -1, -1 false, false, false, false, false, -1, -1
}; };
static bool cursor_enabled = true; static bool cursor_enabled = true;
static int height, width; static int height, width;
@@ -338,11 +338,10 @@ static void set_highlight_args(int mask, HlAttrs *attrs)
} }
attrs->bold = mask & HL_BOLD; attrs->bold = mask & HL_BOLD;
attrs->standout = mask & HL_STANDOUT;
attrs->underline = mask & HL_UNDERLINE; attrs->underline = mask & HL_UNDERLINE;
attrs->undercurl = mask & HL_UNDERCURL; attrs->undercurl = mask & HL_UNDERCURL;
attrs->italic = mask & HL_ITALIC; attrs->italic = mask & HL_ITALIC;
attrs->reverse = mask & HL_INVERSE; attrs->reverse = mask & (HL_INVERSE | HL_STANDOUT);
attrs->foreground = aep && aep->fg_color >= 0 ? aep->fg_color : normal_fg; attrs->foreground = aep && aep->fg_color >= 0 ? aep->fg_color : normal_fg;
attrs->background = aep && aep->bg_color >= 0 ? aep->bg_color : normal_bg; attrs->background = aep && aep->bg_color >= 0 ? aep->bg_color : normal_bg;
} }

View File

@@ -6,7 +6,7 @@
#include <stdint.h> #include <stdint.h>
typedef struct { typedef struct {
bool bold, standout, underline, undercurl, italic, reverse; bool bold, underline, undercurl, italic, reverse;
int foreground, background; int foreground, background;
} HlAttrs; } HlAttrs;