diff src/getchar.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 506bf60a30a0
children 084b28fb3d22
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1325,10 +1325,8 @@ save_typebuf(void)
 
 static int old_char = -1;	/* character put back by vungetc() */
 static int old_mod_mask;	/* mod_mask for ungotten character */
-#ifdef FEAT_MOUSE
 static int old_mouse_row;	/* mouse_row related to old_char */
 static int old_mouse_col;	/* mouse_col related to old_char */
-#endif
 
 /*
  * Save all three kinds of typeahead, so that the user must type at a prompt.
@@ -1559,10 +1557,8 @@ vgetc(void)
 	c = old_char;
 	old_char = -1;
 	mod_mask = old_mod_mask;
-#ifdef FEAT_MOUSE
 	mouse_row = old_mouse_row;
 	mouse_col = old_mouse_col;
-#endif
     }
     else
     {
@@ -2007,7 +2003,6 @@ f_getchar(typval_T *argvars, typval_T *r
 	rettv->v_type = VAR_STRING;
 	rettv->vval.v_string = vim_strsave(temp);
 
-#ifdef FEAT_MOUSE
 	if (is_mouse_key(n))
 	{
 	    int		row = mouse_row;
@@ -2025,11 +2020,11 @@ f_getchar(typval_T *argvars, typval_T *r
 		if (win == NULL)
 		    return;
 		(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
-# ifdef FEAT_TEXT_PROP
+#ifdef FEAT_TEXT_PROP
 		if (WIN_IS_POPUP(win))
 		    winnr = 0;
 		else
-# endif
+#endif
 		    for (wp = firstwin; wp != win && wp != NULL;
 							       wp = wp->w_next)
 			++winnr;
@@ -2039,7 +2034,6 @@ f_getchar(typval_T *argvars, typval_T *r
 		set_vim_var_nr(VV_MOUSE_COL, col + 1);
 	    }
 	}
-#endif
     }
 }
 
@@ -2636,10 +2630,8 @@ vungetc(int c)
 {
     old_char = c;
     old_mod_mask = mod_mask;
-#ifdef FEAT_MOUSE
     old_mouse_row = mouse_row;
     old_mouse_col = mouse_col;
-#endif
 }
 
 /*