aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-08 11:57:31 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-08 11:57:31 +0000
commit4e25019ba6bd1bd07925ccafc2936416ef3f7cbe (patch)
tree00c0e30177eb2e966ac021a4d42c3a9f1219f77d /grid.c
parentcell: packing the cell struct seems to help performance (diff)
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.
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/grid.c b/grid.c
index c08a002e..b36c5e0b 100644
--- a/grid.c
+++ b/grid.c
@@ -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