summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-11 19:30:45 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-11 19:30:45 +0100
commitc48369c3fc507f398abbc933a60f653c6abe6701 (patch)
tree4c7f4a91eb8877c72c64ec0a615bfeac6064a50e /src/ui.c
parente87303af3236b8fb5e1e3be4d0e2209344fbf8b2 (diff)
downloadvim-git-c48369c3fc507f398abbc933a60f653c6abe6701.tar.gz
patch 8.0.1598: cannot select text in a terminal with the mousev8.0.1598
Problem: Cannot select text in a terminal with the mouse. Solution: When a job in a terminal is not consuming mouse events, use them for modeless selection. Also stop Insert mode when clicking in a terminal window.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ui.c b/src/ui.c
index 981f07f45..87f3c1eb6 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -2827,11 +2827,18 @@ retnomove:
* (MOUSE_FOCUS was set above if we dragged first). */
if (dragwin == NULL || (flags & MOUSE_RELEASED))
win_enter(wp, TRUE); /* can make wp invalid! */
-#ifdef CHECK_DOUBLE_CLICK
- /* set topline, to be able to check for double click ourselves */
+
if (curwin != old_curwin)
+ {
+#ifdef CHECK_DOUBLE_CLICK
+ /* set topline, to be able to check for double click ourselves */
set_mouse_topline(curwin);
#endif
+#ifdef FEAT_TERMINAL
+ /* when entering a terminal window may change state */
+ term_win_entered();
+#endif
+ }
if (on_status_line) /* In (or below) status line */
{
/* Don't use start_arrow() if we're in the same window */