From 20db7cee2dc1d61e0a9894373e30b1e7ae393a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 12 Mar 2016 16:40:09 +0100 Subject: ui: use correct default cell style This is important for files without associated syntax highlighting. The selections should now again be visible. --- ui-curses.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]); -- cgit v1.2.3