From 69453a73fce015b9dd9deb6a9f6ab9aad104619b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 9 Dec 2017 12:01:03 +0100 Subject: vis: make selections visible when lua support has been disabled When the fore and background colors are the same, swapping them has no effect. Instead use the specified cell attributes. Previously the CELL_ATTR_REVERSE used in the default selection style was ignored. In general the default style definitions for non-Lua builds could probably be improved further. Fix #635 --- vis.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index edf3f0c..4990aed 100644 --- a/vis.c +++ b/vis.c @@ -352,8 +352,12 @@ static void window_draw_selection(View *view, Selection *cur, CellStyle *style) while (col < end) { if (cell_color_equal(l->cells[col].style.fg, style->bg)) { CellStyle old = l->cells[col].style; - l->cells[col].style.fg = old.bg; - l->cells[col].style.bg = old.fg; + if (!cell_color_equal(old.fg, old.bg)) { + l->cells[col].style.fg = old.bg; + l->cells[col].style.bg = old.fg; + } else { + l->cells[col].style.attr = style->attr; + } } else { l->cells[col].style.bg = style->bg; } -- cgit v1.2.3