diff options
Diffstat (limited to 'src/nvim/ugrid.h')
-rw-r--r-- | src/nvim/ugrid.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/nvim/ugrid.h b/src/nvim/ugrid.h index 035074846e..33a706b8c0 100644 --- a/src/nvim/ugrid.h +++ b/src/nvim/ugrid.h @@ -7,33 +7,28 @@ typedef struct ucell UCell; typedef struct ugrid UGrid; -#define CELLBYTES (4 * (MAX_MCO+1)) +#define CELLBYTES (sizeof(schar_T)) struct ucell { char data[CELLBYTES + 1]; - HlAttrs attrs; + sattr_T attr; }; struct ugrid { - int top, bot, left, right; int row, col; - HlAttrs clear_attrs; int width, height; - HlAttrs attrs; UCell **cells; }; // -V:UGRID_FOREACH_CELL:625 -#define UGRID_FOREACH_CELL(grid, top, bot, left, right, code) \ +#define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \ do { \ - for (int row = top; row <= bot; row++) { \ - UCell *row_cells = (grid)->cells[row]; \ - for (int col = left; col <= right; col++) { \ - UCell *cell = row_cells + col; \ - (void)(cell); \ - code; \ - } \ + UCell *row_cells = (grid)->cells[row]; \ + for (int col = startcol; col < endcol; col++) { \ + UCell *cell = row_cells + col; \ + (void)(cell); \ + code; \ } \ } while (0) |