=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.187 retrieving revision 1.188 diff -c -r1.187 -r1.188 *** src/usr.bin/tmux/window-copy.c 2018/03/08 08:09:10 1.187 --- src/usr.bin/tmux/window-copy.c 2018/04/23 13:46:34 1.188 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.187 2018/03/08 08:09:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.188 2018/04/23 13:46:34 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1548,1554 **** char *buf; size_t off; u_int i, xx, yy, sx, sy, ex, ey, ey_last; ! u_int firstsx, lastex, restex, restsx; int keys; if (!s->sel.flag && s->sel.lineflag == LINE_SEL_NONE) --- 1548,1554 ---- char *buf; size_t off; u_int i, xx, yy, sx, sy, ex, ey, ey_last; ! u_int firstsx, lastex, restex, restsx, selx; int keys; if (!s->sel.flag && s->sel.lineflag == LINE_SEL_NONE) *************** *** 1599,1605 **** * Need to ignore the column with the cursor in it, which for * rectangular copy means knowing which side the cursor is on. */ ! if (data->selx < data->cx) { /* Selection start is on the left. */ if (keys == MODEKEY_EMACS) { lastex = data->cx; --- 1599,1609 ---- * Need to ignore the column with the cursor in it, which for * rectangular copy means knowing which side the cursor is on. */ ! if (data->cursordrag == CURSORDRAG_ENDSEL) ! selx = data->selx; ! else ! selx = data->endselx; ! if (selx < data->cx) { /* Selection start is on the left. */ if (keys == MODEKEY_EMACS) { lastex = data->cx; *************** *** 1609,1620 **** lastex = data->cx + 1; restex = data->cx + 1; } ! firstsx = data->selx; ! restsx = data->selx; } else { /* Cursor is on the left. */ ! lastex = data->selx + 1; ! restex = data->selx + 1; firstsx = data->cx; restsx = data->cx; } --- 1613,1624 ---- lastex = data->cx + 1; restex = data->cx + 1; } ! firstsx = selx; ! restsx = selx; } else { /* Cursor is on the left. */ ! lastex = selx + 1; ! restex = selx + 1; firstsx = data->cx; restsx = data->cx; }