diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-04-08 13:34:27 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2015-04-09 16:38:32 +0200 |
commit | cd7b910e8144dcc6092c7b1e1bfdc3193fdd643b (patch) | |
tree | 0a40a1766194763d035e7afdfd74a172349e0d08 /src/nvim/terminal.c | |
parent | bae1da3f74ec91b8a79c764aa0277d96c932b2aa (diff) | |
download | rneovim-cd7b910e8144dcc6092c7b1e1bfdc3193fdd643b.tar.gz rneovim-cd7b910e8144dcc6092c7b1e1bfdc3193fdd643b.tar.bz2 rneovim-cd7b910e8144dcc6092c7b1e1bfdc3193fdd643b.zip |
Add new highlight groups TermCursor/TermCursorNC
These highlight groups replace the old mechanism of setting:
- {g,b}:terminal_focused_cursor_highlight
- {g,b}:terminal_unfocused_cursor_highlight
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 2149f0f998..4007dfb04d 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -130,8 +130,6 @@ struct terminal { // the default values are used to obtain the color numbers passed to cterm // colors RgbValue colors[256]; - // attributes for focused/unfocused cursor cells - int focused_cursor_attr_id, unfocused_cursor_attr_id; }; static VTermScreenCallbacks vterm_screen_callbacks = { @@ -260,41 +258,6 @@ Terminal *terminal_open(TerminalOptions opts) } } - // Configure cursor highlighting when focused/unfocused - char *group = get_config_string(rv, "terminal_focused_cursor_highlight"); - if (group) { - int group_id = syn_name2id((uint8_t *)group); - free(group); - - if (group_id) { - rv->focused_cursor_attr_id = syn_id2attr(group_id); - } - } - if (!rv->focused_cursor_attr_id) { - rv->focused_cursor_attr_id = get_attr_entry(&(attrentry_T) { - .rgb_ae_attr = HL_INVERSE, .rgb_fg_color = -1, .rgb_bg_color = -1, - .cterm_ae_attr = HL_INVERSE, .cterm_fg_color = 0, .cterm_bg_color = 0 - }); - } - - group = get_config_string(rv, "terminal_unfocused_cursor_highlight"); - if (group) { - int group_id = syn_name2id((uint8_t *)group); - free(group); - - if (group_id) { - rv->unfocused_cursor_attr_id = syn_id2attr(group_id); - } - } - if (!rv->unfocused_cursor_attr_id) { - int yellow_rgb = RGB(0xfc, 0xe9, 0x4f); - int yellow_term = 12; - rv->unfocused_cursor_attr_id = get_attr_entry(&(attrentry_T) { - .rgb_ae_attr = 0, .rgb_fg_color = -1, .rgb_bg_color = yellow_rgb, - .cterm_ae_attr = 0, .cterm_fg_color = 0, .cterm_bg_color = yellow_term, - }); - } - return rv; } @@ -555,7 +518,7 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr, if (term->cursor.visible && term->cursor.row == row && term->cursor.col == col) { attr_id = hl_combine_attr(attr_id, is_focused(term) && wp == curwin ? - term->focused_cursor_attr_id : term->unfocused_cursor_attr_id); + hl_attr(HLF_TERM) : hl_attr(HLF_TERMNC)); } term_attrs[col] = attr_id; |