diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-07-21 14:41:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 14:41:49 +0200 |
commit | 94841e5eaebc3f2fb556056dd676afff21ff5d23 (patch) | |
tree | 2bf31609b6f8e0fcb283ea4d776b39c654e9f399 /src/nvim/ugrid.c | |
parent | 5ff90a100a2af99ee4236995bef221a41eb2f643 (diff) | |
parent | 6b8cd827a98e69eb61c107bff02ad953e240d787 (diff) | |
download | rneovim-94841e5eaebc3f2fb556056dd676afff21ff5d23.tar.gz rneovim-94841e5eaebc3f2fb556056dd676afff21ff5d23.tar.bz2 rneovim-94841e5eaebc3f2fb556056dd676afff21ff5d23.zip |
Merge pull request #8221 from bfredl/hlstate
UI grid protocol revision: line based updates and semantic highlights
Diffstat (limited to 'src/nvim/ugrid.c')
-rw-r--r-- | src/nvim/ugrid.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/ugrid.c b/src/nvim/ugrid.c index 6d420ef2f8..48f3cff2d7 100644 --- a/src/nvim/ugrid.c +++ b/src/nvim/ugrid.c @@ -17,7 +17,6 @@ void ugrid_init(UGrid *grid) { grid->attrs = HLATTRS_INIT; - grid->clear_attrs = HLATTRS_INIT; grid->cells = NULL; } @@ -45,12 +44,13 @@ void ugrid_resize(UGrid *grid, int width, int height) void ugrid_clear(UGrid *grid) { - clear_region(grid, grid->top, grid->bot, grid->left, grid->right); + clear_region(grid, grid->top, grid->bot, grid->left, grid->right, + HLATTRS_INIT); } -void ugrid_eol_clear(UGrid *grid) +void ugrid_clear_chunk(UGrid *grid, int row, int col, int endcol, HlAttrs attrs) { - clear_region(grid, grid->row, grid->row, grid->col, grid->right); + clear_region(grid, row, row, col, endcol-1, attrs); } void ugrid_goto(UGrid *grid, int row, int col) @@ -99,7 +99,8 @@ void ugrid_scroll(UGrid *grid, int count, int *clear_top, int *clear_bot) *clear_bot = stop; *clear_top = stop + count + 1; } - clear_region(grid, *clear_top, *clear_bot, grid->left, grid->right); + clear_region(grid, *clear_top, *clear_bot, grid->left, grid->right, + HLATTRS_INIT); } UCell *ugrid_put(UGrid *grid, uint8_t *text, size_t size) @@ -117,13 +118,13 @@ UCell *ugrid_put(UGrid *grid, uint8_t *text, size_t size) return cell; } -static void clear_region(UGrid *grid, int top, int bot, int left, int right) +static void clear_region(UGrid *grid, int top, int bot, int left, int right, + HlAttrs attrs) { - HlAttrs clear_attrs = grid->clear_attrs; UGRID_FOREACH_CELL(grid, top, bot, left, right, { cell->data[0] = ' '; cell->data[1] = 0; - cell->attrs = clear_attrs; + cell->attrs = attrs; }); } |