diff src/ui.c @ 13448:a62b0bbc8834 v8.0.1598

patch 8.0.1598: cannot select text in a terminal with the mouse commit https://github.com/vim/vim/commit/c48369c3fc507f398abbc933a60f653c6abe6701 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 11 19:30:45 2018 +0100 patch 8.0.1598: cannot select text in a terminal with the mouse 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.
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Mar 2018 19:45:05 +0100
parents 69517d67421f
children 63679d671ced
line wrap: on
line diff
--- 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! */
+
+	if (curwin != old_curwin)
+	{
 #ifdef CHECK_DOUBLE_CLICK
-	/* set topline, to be able to check for double click ourselves */
-	if (curwin != old_curwin)
+	    /* 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 */