diff src/move.c @ 18354:9f51d0cef8da v8.1.2171

patch 8.1.2171: mouse support not always available Commit: https://github.com/vim/vim/commit/a1cb1d1dce14dd005797590721f1bcd0e7c3b35f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 17 23:00:07 2019 +0200 patch 8.1.2171: mouse support not always available Problem: Mouse support not always available. Solution: Enable mouse support also in tiny version. Do not define FEAT_MOUSE_XTERM on MS-Windows (didn't really work).
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Oct 2019 23:15:04 +0200
parents 08f1dd29550e
children 66964658cc3c
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -190,9 +190,7 @@ update_topline(void)
     int		check_topline = FALSE;
     int		check_botline = FALSE;
     long        *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
-#ifdef FEAT_MOUSE
     int		save_so = *so_ptr;
-#endif
 
     /* If there is no valid screen and when the window height is zero just use
      * the cursor line. */
@@ -209,11 +207,9 @@ update_topline(void)
     if (curwin->w_valid & VALID_TOPLINE)
 	return;
 
-#ifdef FEAT_MOUSE
     /* When dragging with the mouse, don't scroll that quickly */
     if (mouse_dragging > 0)
 	*so_ptr = mouse_dragging - 1;
-#endif
 
     old_topline = curwin->w_topline;
 #ifdef FEAT_DIFF
@@ -418,9 +414,7 @@ update_topline(void)
 	    validate_cursor();
     }
 
-#ifdef FEAT_MOUSE
     *so_ptr = save_so;
-#endif
 }
 
 /*
@@ -1751,10 +1745,8 @@ scroll_cursor_top(int min_scroll, int al
     linenr_T	new_topline;
     int		off = get_scrolloff_value();
 
-#ifdef FEAT_MOUSE
     if (mouse_dragging > 0)
 	off = mouse_dragging - 1;
-#endif
 
     /*
      * Decrease topline until:
@@ -2004,11 +1996,7 @@ scroll_cursor_bot(int min_scroll, int se
 	/* Stop when scrolled nothing or at least "min_scroll", found "extra"
 	 * context for 'scrolloff' and counted all lines below the window. */
 	if ((((scrolled <= 0 || scrolled >= min_scroll)
-			&& extra >= (
-#ifdef FEAT_MOUSE
-			    mouse_dragging > 0 ? mouse_dragging - 1 :
-#endif
-			    so))
+		    && extra >= (mouse_dragging > 0 ? mouse_dragging - 1 : so))
 		    || boff.lnum + 1 > curbuf->b_ml.ml_line_count)
 		&& loff.lnum <= curwin->w_botline
 #ifdef FEAT_DIFF
@@ -2050,11 +2038,8 @@ scroll_cursor_bot(int min_scroll, int se
 	    used += boff.height;
 	    if (used > curwin->w_height)
 		break;
-	    if (extra < (
-#ifdef FEAT_MOUSE
-			mouse_dragging > 0 ? mouse_dragging - 1 :
-#endif
-			so) || scrolled < min_scroll)
+	    if (extra < ( mouse_dragging > 0 ? mouse_dragging - 1 : so)
+		    || scrolled < min_scroll)
 	    {
 		extra += boff.height;
 		if (boff.lnum >= curwin->w_botline
@@ -2230,13 +2215,11 @@ cursor_correct(void)
      */
     above_wanted = so;
     below_wanted = so;
-#ifdef FEAT_MOUSE
     if (mouse_dragging > 0)
     {
 	above_wanted = mouse_dragging - 1;
 	below_wanted = mouse_dragging - 1;
     }
-#endif
     if (curwin->w_topline == 1)
     {
 	above_wanted = 0;
@@ -2246,10 +2229,7 @@ cursor_correct(void)
     }
     validate_botline();
     if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1
-#ifdef FEAT_MOUSE
-	    && mouse_dragging == 0
-#endif
-	    )
+	    && mouse_dragging == 0)
     {
 	below_wanted = 0;
 	max_off = (curwin->w_height - 1) / 2;