mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Merge branch 'obsd-master'
This commit is contained in:
8
screen.c
8
screen.c
@@ -36,6 +36,8 @@ struct screen_sel {
|
||||
u_int ex;
|
||||
u_int ey;
|
||||
|
||||
u_int clipx;
|
||||
|
||||
struct grid_cell cell;
|
||||
};
|
||||
|
||||
@@ -465,7 +467,8 @@ screen_resize_y(struct screen *s, u_int sy, int eat_empty, u_int *cy)
|
||||
/* Set selection. */
|
||||
void
|
||||
screen_set_selection(struct screen *s, u_int sx, u_int sy,
|
||||
u_int ex, u_int ey, u_int rectangle, int modekeys, struct grid_cell *gc)
|
||||
u_int ex, u_int ey, u_int rectangle, u_int clipx, int modekeys,
|
||||
struct grid_cell *gc)
|
||||
{
|
||||
if (s->sel == NULL)
|
||||
s->sel = xcalloc(1, sizeof *s->sel);
|
||||
@@ -479,6 +482,7 @@ screen_set_selection(struct screen *s, u_int sx, u_int sy,
|
||||
s->sel->sy = sy;
|
||||
s->sel->ex = ex;
|
||||
s->sel->ey = ey;
|
||||
s->sel->clipx = clipx;
|
||||
}
|
||||
|
||||
/* Clear selection. */
|
||||
@@ -506,6 +510,8 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
|
||||
|
||||
if (sel == NULL || sel->hidden)
|
||||
return (0);
|
||||
if (px < sel->clipx)
|
||||
return (0);
|
||||
|
||||
if (sel->rectangle) {
|
||||
if (sel->sy < sel->ey) {
|
||||
|
||||
Reference in New Issue
Block a user