summaryrefslogtreecommitdiffstats
path: root/grid-view.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-24 22:04:18 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-24 22:04:18 +0000
commit096cbf2ea558c0f66ee7bdaa8316e85c3e55ee69 (patch)
tree391e8a760c20119718ef422026d3713f752ce730 /grid-view.c
parentf4b8f00255eb4e5d1e7b5e989d8dd48f34716c46 (diff)
Add a dedicated function to convert a line into a string and use it to simplify the search window function.
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/grid-view.c b/grid-view.c
index f1224bf6..75dc686a 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -209,3 +209,15 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
grid_move_cells(gd, px, px + nx, py, (sx - 1) - (px + nx));
}
+
+/* Convert cells into a string. */
+char *
+grid_view_string_cells(struct grid *gd, u_int px, u_int py, u_int nx)
+{
+ GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
+
+ px = grid_view_x(gd, px);
+ py = grid_view_y(gd, py);
+
+ return (grid_string_cells(gd, px, py, nx));
+}