diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-12-09 12:01:03 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-12-09 12:23:07 +0100 |
| commit | 69453a73fce015b9dd9deb6a9f6ab9aad104619b (patch) | |
| tree | 7a6e6cc2ab130c0a5b5ac4a3486de7a5e59ffabb /vis.c | |
| parent | 8e27737bd4e9ff1c275a0cb439bfe2280ffa3f62 (diff) | |
| download | vis-69453a73fce015b9dd9deb6a9f6ab9aad104619b.tar.gz vis-69453a73fce015b9dd9deb6a9f6ab9aad104619b.tar.xz | |
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
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |
