diff options
author | 2010-12-11 17:56:01 +0000 | |
---|---|---|
committer | 2010-12-11 17:56:01 +0000 | |
commit | 998044b525a194258b39d7ecbf48a7cd6624b46c (patch) | |
tree | ba55d6145efb6ec771037f41e749e7e9fe9c1f66 | |
parent | Oops, these functions return a const char *, so make the local variable (diff) | |
download | wireguard-openbsd-998044b525a194258b39d7ecbf48a7cd6624b46c.tar.xz wireguard-openbsd-998044b525a194258b39d7ecbf48a7cd6624b46c.zip |
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.
-rw-r--r-- | usr.bin/tmux/screen.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 6 |
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 { /* |