aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ugrid.h
blob: 54cd33e58fae8767b1b581dc4b932a2f96388900 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "nvim/types_defs.h"

typedef struct ucell {
  schar_T data;
  sattr_T attr;
} UCell;

typedef struct ugrid {
  int row, col;
  int width, height;
  UCell **cells;
} UGrid;

#define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \
  do { \
    UCell *row_cells = (grid)->cells[row]; \
    for (int curcol = startcol; curcol < endcol; curcol++) { \
      UCell *cell = row_cells + curcol; \
      (void)(cell); \
      code; \
    } \
  } while (0)

#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ugrid.h.generated.h"
#endif