diff options
author | Matthieu Coudron <mattator@gmail.com> | 2017-07-26 23:28:26 +0200 |
---|---|---|
committer | Matthieu Coudron <mattator@gmail.com> | 2017-09-30 11:43:26 +0900 |
commit | ba7277cfb4e2556f246446d06b53f3427f28130f (patch) | |
tree | 4e5137c99a53d8a300b7f7805b5940535e18effe /src/nvim/tui/tui.c | |
parent | c580ef68e873745ae02a577f11cbabb5e43271e4 (diff) | |
download | rneovim-ba7277cfb4e2556f246446d06b53f3427f28130f.tar.gz rneovim-ba7277cfb4e2556f246446d06b53f3427f28130f.tar.bz2 rneovim-ba7277cfb4e2556f246446d06b53f3427f28130f.zip |
Adds nvim_get_hl_by_name/by_id
...in order to retrieve highlights.
Added test/functional/api/highlight_spec.lua
HL_NORMAL is not really a good name, since it's more like an empty attribute than the normal's one.
If one pays attention, syn_cterm_attr2entry is never called with attr=0 because it's always special cased before.
I suggest in subsequent PRs we remove the ATTR_OFF and just insert an EMPTY ATTR/RESET_ATTR/UNINITIALIZED for id 0.
Diffstat (limited to 'src/nvim/tui/tui.c')
-rw-r--r-- | src/nvim/tui/tui.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 256772489d..8e0e905bcd 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -288,7 +288,7 @@ static void terminfo_stop(UI *ui) static void tui_terminal_start(UI *ui) { TUIData *data = ui->data; - data->print_attrs = EMPTY_ATTRS; + data->print_attrs = HLATTRS_INIT; ugrid_init(&data->grid); terminfo_start(ui); update_size(ui); @@ -628,7 +628,7 @@ static void clear_region(UI *ui, int top, int bot, int left, int right) if (grid->bg == -1 && right == ui->width -1) { // Background is set to the default color and the right edge matches the // screen end, try to use terminal codes for clearing the requested area. - HlAttrs clear_attrs = EMPTY_ATTRS; + HlAttrs clear_attrs = HLATTRS_INIT; clear_attrs.foreground = grid->fg; clear_attrs.background = grid->bg; update_attrs(ui, clear_attrs); @@ -926,7 +926,7 @@ static void tui_scroll(UI *ui, Integer count) cursor_goto(ui, grid->top, grid->left); // also set default color attributes or some terminals can become funny if (scroll_clears_to_current_colour) { - HlAttrs clear_attrs = EMPTY_ATTRS; + HlAttrs clear_attrs = HLATTRS_INIT; clear_attrs.foreground = grid->fg; clear_attrs.background = grid->bg; update_attrs(ui, clear_attrs); |