wip: grid is now represented as a grid, not a linear array

The grid is now represented with an array of row *pointers*. Each row
contains an array of cells (the row's columns).

The main point of having row pointers is we can now move rows around
almost for free.

This is useful when scrolling with scroll margins for example, where
we previously had to copy the lines in the margins. Now it's just a
matter of swapping two pointers.
This commit is contained in:
Daniel Eklöf 2019-07-08 13:57:31 +02:00
parent 98db7f58cb
commit 4e25019ba6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 457 additions and 81 deletions

3
grid.c
View file

@ -6,7 +6,7 @@
#define LOG_MODULE "grid"
#define LOG_ENABLE_DBG 0
#include "log.h"
#if 0
struct cell *
grid_get_range(struct grid *grid, int start, int *length)
{
@ -89,3 +89,4 @@ grid_memmove(struct grid *grid, int dst, int src, int length)
copy_idx += count;
}
}
#endif