aboutsummaryrefslogtreecommitdiff
path: root/grid.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-10 12:57:26 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-10 12:57:26 +0000
commit0bc3b29b0fef9c3dc8fd1e54f56438d809e45a91 (patch)
treef2a7653f5f5e4a4ff00725609e0bfbaf095839c8 /grid.h
parentinput: fix backspace escape sequences (diff)
parentscrollback: disable debug logging (diff)
Merge branch 'scrollback'
Diffstat (limited to 'grid.h')
-rw-r--r--grid.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/grid.h b/grid.h
index d6ddabee..e170f6dd 100644
--- a/grid.h
+++ b/grid.h
@@ -10,6 +10,13 @@ grid_row(struct grid *grid, int row)
return grid->rows[(grid->offset + row + grid->num_rows) % grid->num_rows];
}
+static inline struct row *
+grid_row_in_view(struct grid *grid, int row)
+{
+ assert(grid->view >= 0);
+ return grid->rows[(grid->view + row + grid->num_rows) % grid->num_rows];
+}
+
static inline void
grid_swap_row(struct grid *grid, int row_a, int row_b)
{