summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/grid-view.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-06-24 22:04:19 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-06-24 22:04:19 +0000
commitcf4d2a9f2dbc1c2c23122b99c17349f01e64f168 (patch)
treee777fc698f74f6d8cf470f9cf934916762072f43 /usr.bin/tmux/grid-view.c
parent43ed6af81c7fd9a856ae611e2e5eedb7c5045f62 (diff)
Add a dedicated function to convert a line into a string and use it to simplify the search window function.
Diffstat (limited to 'usr.bin/tmux/grid-view.c')
-rw-r--r--usr.bin/tmux/grid-view.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/tmux/grid-view.c b/usr.bin/tmux/grid-view.c
index 7e4920ac7f8..8154495b544 100644
--- a/usr.bin/tmux/grid-view.c
+++ b/usr.bin/tmux/grid-view.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid-view.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */
+/* $OpenBSD: grid-view.c,v 1.2 2009/06/24 22:04:18 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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));
+}