vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 080c30436fa7845e593ca052a4ec9fac078a9086 parent 5d3d539ff45189f11dc547e43caf42348f33c034 Author: Marc André Tanner <mat@brain-dump.org> Date: Fri, 28 Oct 2016 10:40:23 +0200 ui: allow cursor line style to override cell attributes Up until now only the background color could be changed. Diffstat:
| M | ui-curses.c | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ui-curses.c b/ui-curses.c @@ -674,7 +674,8 @@ static void ui_window_draw(UiWin *w) { } short selection_bg = win->styles[UI_STYLE_SELECTION].bg; - short cursor_line_bg = win->styles[UI_STYLE_CURSOR_LINE].bg; + short cul_bg = win->styles[UI_STYLE_CURSOR_LINE].bg; + attr_t cul_attr = win->styles[UI_STYLE_CURSOR_LINE].attr; bool multiple_cursors = view_cursors_multiple(win->view); attr_t attr = A_NORMAL; @@ -699,7 +700,7 @@ static void ui_window_draw(UiWin *w) { attr = style->attr | COLOR_PAIR(color_pair_get(style->fg, selection_bg)); prev_style = NULL; } else if (cursor_line) { - attr = style->attr | COLOR_PAIR(color_pair_get(style->fg, cursor_line_bg)); + attr = cul_attr | (style->attr & ~A_COLOR) | COLOR_PAIR(color_pair_get(style->fg, cul_bg)); prev_style = NULL; } else if (style != prev_style) { attr = style_to_attr(style);