summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-12-11 17:56:02 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-12-11 17:56:02 +0000
commita606b76773893d4546e8cab18696573ebeda4fea (patch)
tree28c697908b2af241b049bff9fb2bc81e7e61219a /usr.bin
parente6bb77fab7a8949a8690910bc455cf171ddb0e0f (diff)
Fix rectangle copy to behave like emacs - the cursor is not part of the
selection on the right edge but on the left it is.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/screen.c6
-rw-r--r--usr.bin/tmux/window-copy.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c
index efcca0d0cc5..fcd97f33592 100644
--- a/usr.bin/tmux/screen.c
+++ b/usr.bin/tmux/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.16 2010/04/06 21:35:44 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.17 2010/12/11 17:56:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -287,7 +287,7 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
*/
if (sel->ex < sel->sx) {
/* Cursor (ex) is on the left. */
- if (px <= sel->ex)
+ if (px < sel->ex)
return (0);
if (px > sel->sx)
@@ -297,7 +297,7 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
if (px < sel->sx)
return (0);
- if (px >= sel->ex)
+ if (px > sel->ex)
return (0);
}
} else {
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index f4097c15e72..c1f1bbb1a5e 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.63 2010/09/11 15:39:55 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.64 2010/12/11 17:56:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1267,8 +1267,8 @@ window_copy_copy_selection(struct window_pane *wp, struct session *sess)
/* Cursor is on the left. */
lastex = data->selx + 1;
restex = data->selx + 1;
- firstsx = data->cx + 1;
- restsx = data->cx + 1;
+ firstsx = data->cx;
+ restsx = data->cx;
}
} else {
/*