diff options
author | 2019-01-15 09:56:31 +0000 | |
---|---|---|
committer | 2019-01-15 09:56:31 +0000 | |
commit | 5bf9cff13abb05dcc43fd6a0e8994c24f8e7ce6d (patch) | |
tree | 30ee9c4bc4e8310c327b601d44812fc225971259 | |
parent | Regex flags should include REG_NEWLINE and REG_ICASE should actually be (diff) | |
download | wireguard-openbsd-5bf9cff13abb05dcc43fd6a0e8994c24f8e7ce6d.tar.xz wireguard-openbsd-5bf9cff13abb05dcc43fd6a0e8994c24f8e7ce6d.zip |
Do not highlight characters which will not be copied, reported by
Jaroslaw Rzeszotko.
-rw-r--r-- | usr.bin/tmux/screen.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c index cb12801a676..6fa6cd4eb7d 100644 --- a/usr.bin/tmux/screen.c +++ b/usr.bin/tmux/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.52 2018/07/31 11:49:26 nicm Exp $ */ +/* $OpenBSD: screen.c,v 1.53 2019/01/15 09:56:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -425,7 +425,11 @@ screen_check_selection(struct screen *s, u_int px, u_int py) if (py == sel->sy && px < sel->sx) return (0); - if (py == sel->ey && px > sel->ex) + if (sel->modekeys == MODEKEY_EMACS) + xx = (sel->ex == 0 ? 0 : sel->ex - 1); + else + xx = sel->ex; + if (py == sel->ey && px > xx) return (0); } else if (sel->sy > sel->ey) { /* starting line > ending line -- upward selection. */ @@ -456,7 +460,11 @@ screen_check_selection(struct screen *s, u_int px, u_int py) return (0); } else { /* selection start (sx) is on the left */ - if (px < sel->sx || px > sel->ex) + if (sel->modekeys == MODEKEY_EMACS) + xx = (sel->ex == 0 ? 0 : sel->ex - 1); + else + xx = sel->ex; + if (px < sel->sx || px > xx) return (0); } } |