diff options
author | nicm <nicm> | 2019-05-26 17:34:45 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-05-26 17:34:45 +0000 |
commit | e90d4a6021a45e4f281c75e5513ede2d010ede32 (patch) | |
tree | fee53e188a26f7221239aee44cec4b383557d54e /grid.c | |
parent | 64310051694fd5c82ccbcff9fda6488ea2dcfb96 (diff) | |
download | rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.tar.gz rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.tar.bz2 rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.zip |
Add formats for word and line under the mouse and use them to add some
items to the pane menu.
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1350,3 +1350,22 @@ grid_unwrap_position(struct grid *gd, u_int *px, u_int *py, u_int wx, u_int wy) *px = wx; *py = yy; } + +/* Get length of line. */ +u_int +grid_line_length(struct grid *gd, u_int py) +{ + struct grid_cell gc; + u_int px; + + px = grid_get_line(gd, py)->cellsize; + if (px > gd->sx) + px = gd->sx; + while (px > 0) { + grid_get_cell(gd, px - 1, py, &gc); + if (gc.data.size != 1 || *gc.data.data != ' ') + break; + px--; + } + return (px); +} |