mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Add a dedicated function to convert a line into a string and use it to simplify the search window function.
This commit is contained in:
14
grid-view.c
14
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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user