aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ugrid.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ugrid.h')
-rw-r--r--src/nvim/ugrid.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/nvim/ugrid.h b/src/nvim/ugrid.h
index 268362bf1b..19c2e99ebb 100644
--- a/src/nvim/ugrid.h
+++ b/src/nvim/ugrid.h
@@ -7,31 +7,28 @@
typedef struct ucell UCell;
typedef struct ugrid UGrid;
+#define CELLBYTES (sizeof(schar_T))
+
struct ucell {
- char data[6 * MAX_MCO + 1];
- HlAttrs attrs;
+ char data[CELLBYTES + 1];
+ sattr_T attr;
};
struct ugrid {
- int top, bot, left, right;
int row, col;
- int bg, fg;
int width, height;
- HlAttrs attrs;
UCell **cells;
};
-#define EMPTY_ATTRS ((HlAttrs){ false, false, false, false, false, -1, -1, -1 })
+// -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 curcol = startcol; curcol < endcol; curcol++) { \
+ UCell *cell = row_cells + curcol; \
+ (void)(cell); \
+ code; \
} \
} while (0)