diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-01-15 12:02:36 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-01-15 12:02:36 +0000 |
commit | 469a9e94397b1099ee08cbf1d9ba4866a3d898b4 (patch) | |
tree | 9f4232633f18ee9cac284e37bab96812423c9537 | |
parent | c9d482ab489d5d57d481858091608ee1b32e46ab (diff) | |
parent | 34c0807be6add421bc4624d498adf9f55d00a120 (diff) | |
download | rtmux-469a9e94397b1099ee08cbf1d9ba4866a3d898b4.tar.gz rtmux-469a9e94397b1099ee08cbf1d9ba4866a3d898b4.tar.bz2 rtmux-469a9e94397b1099ee08cbf1d9ba4866a3d898b4.zip |
Merge branch 'obsd-master'
-rw-r--r-- | screen.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -424,7 +424,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. */ @@ -455,7 +459,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); } } |