diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-03-12 16:40:09 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-03-12 16:40:09 +0100 |
| commit | 20db7cee2dc1d61e0a9894373e30b1e7ae393a4c (patch) | |
| tree | 83f5f9fb6b8ace050aab3835c17e64fbe7b000de /ui-curses.c | |
| parent | 444ac9dffa4a184a8dee1de6543d6d8794b10146 (diff) | |
| download | vis-20db7cee2dc1d61e0a9894373e30b1e7ae393a4c.tar.gz vis-20db7cee2dc1d61e0a9894373e30b1e7ae393a4c.tar.xz | |
ui: use correct default cell style
This is important for files without associated syntax highlighting.
The selections should now again be visible.
Diffstat (limited to 'ui-curses.c')
| -rw-r--r-- | ui-curses.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui-curses.c b/ui-curses.c index a3b48c4..e062ce8 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -688,7 +688,10 @@ static void ui_window_draw(UiWin *w) { for (const Line *l = view_lines_get(win->view); l; l = l->next) { bool cursor_line = l->lineno == cursor_lineno; for (int x = 0; x < width; x++) { - CellStyle *style = &win->styles[l->cells[x].attr]; + unsigned int style_id = l->cells[x].attr; + if (style_id == 0) + style_id = UI_STYLE_DEFAULT; + CellStyle *style = &win->styles[style_id]; if (l->cells[x].cursor && win->ui->selwin == win) { if (multiple_cursors && l->cells[x].cursor_primary) attr = style_to_attr(&win->styles[UI_STYLE_CURSOR_PRIMARY]); |
