neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

ugrid.h (497B)


      1 #pragma once
      2 
      3 #include "nvim/types_defs.h"
      4 
      5 typedef struct {
      6  schar_T data;
      7  sattr_T attr;
      8 } UCell;
      9 
     10 typedef struct {
     11  int row, col;
     12  int width, height;
     13  UCell **cells;
     14 } UGrid;
     15 
     16 #define UGRID_FOREACH_CELL(grid, row, startcol, endcol, code) \
     17  do { \
     18    UCell *row_cells = (grid)->cells[row]; \
     19    for (int curcol = startcol; curcol < endcol; curcol++) { \
     20      UCell *cell = row_cells + curcol; \
     21      (void)(cell); \
     22      code; \
     23    } \
     24  } while (0)
     25 
     26 #include "ugrid.h.generated.h"