aboutsummaryrefslogtreecommitdiff
path: root/grid-view.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:02:37 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:02:37 +0000
commit853ad681620e9a031f41549a39c78d11b2da8990 (patch)
treeba70dc52296728d064ecf6a369a21971381e2a2e /grid-view.c
parente6e1b45fa1aecffe5cd371a6492f38fddecdcd59 (diff)
downloadrtmux-853ad681620e9a031f41549a39c78d11b2da8990.tar.gz
rtmux-853ad681620e9a031f41549a39c78d11b2da8990.tar.bz2
rtmux-853ad681620e9a031f41549a39c78d11b2da8990.zip
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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/grid-view.c b/grid-view.c
index c6a56af8..77becddd 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -1,4 +1,4 @@
-/* $Id: grid-view.c,v 1.11 2009-03-28 20:17:29 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));
+}