To: vim_dev@googlegroups.com Subject: Patch 8.1.2171 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2171 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). Files: src/feature.h, src/edit.c, src/evalfunc.c, src/ex_getln.c, src/getchar.c, src/message.c, src/misc1.c, src/mouse.c, src/move.c, src/normal.c, src/ops.c, src/option.c, src/optionstr.c, src/os_unix.c, src/os_win32.c, src/register.c, src/term.c, src/testing.c, src/window.c, src/globals.h, src/option.h, src/optiondefs.h, src/os_win32.h, src/vim.h, src/version.c *** ../vim-8.1.2170/src/feature.h 2019-09-28 19:04:06.989029610 +0200 --- src/feature.h 2019-10-17 22:55:14.835137469 +0200 *************** *** 964,975 **** * console mouse handling. * +mouse_urxvt Unix only: Include code for for urxvt mosue handling. * +mouse Any mouse support (any of the above enabled). */ /* OS/2 and Amiga console have no mouse support */ ! #if !defined(AMIGA) ! # ifdef FEAT_NORMAL ! # define FEAT_MOUSE_XTERM ! # endif # ifdef FEAT_BIG # define FEAT_MOUSE_NET # endif --- 964,975 ---- * console mouse handling. * +mouse_urxvt Unix only: Include code for for urxvt mosue handling. * +mouse Any mouse support (any of the above enabled). + * Always included, since either FEAT_MOUSE_XTERM or + * DOS_MOUSE is defined. */ /* OS/2 and Amiga console have no mouse support */ ! #if defined(UNIX) || defined(VMS) ! # define FEAT_MOUSE_XTERM # ifdef FEAT_BIG # define FEAT_MOUSE_NET # endif *************** *** 979,990 **** # ifdef FEAT_BIG # define FEAT_MOUSE_URXVT # endif ! # if defined(FEAT_NORMAL) && defined(MSWIN) ! # define DOS_MOUSE ! # endif ! # if defined(FEAT_NORMAL) && defined(__QNX__) ! # define FEAT_MOUSE_PTERM ! # endif #endif /* --- 979,990 ---- # ifdef FEAT_BIG # define FEAT_MOUSE_URXVT # endif ! #endif ! #if defined(MSWIN) ! # define DOS_MOUSE ! #endif ! #if defined(__QNX__) ! # define FEAT_MOUSE_PTERM #endif /* *************** *** 1002,1029 **** # define FEAT_SYSMOUSE #endif ! /* urxvt is a small variation of mouse_xterm, and shares its code */ #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM) # define FEAT_MOUSE_XTERM #endif - /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */ - #if !defined(FEAT_MOUSE_TTY) \ - && (defined(FEAT_MOUSE_XTERM) \ - || defined(FEAT_MOUSE_NET) \ - || defined(FEAT_MOUSE_DEC) \ - || defined(DOS_MOUSE) \ - || defined(FEAT_MOUSE_GPM) \ - || defined(FEAT_MOUSE_JSB) \ - || defined(FEAT_MOUSE_PTERM) \ - || defined(FEAT_SYSMOUSE) \ - || defined(FEAT_MOUSE_URXVT)) - # define FEAT_MOUSE_TTY /* include non-GUI mouse support */ - #endif - #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI)) - # define FEAT_MOUSE /* include generic mouse support */ - #endif - /* * +clipboard Clipboard support. Always used for the GUI. * +xterm_clipboard Unix only: Include code for handling the clipboard --- 1002,1012 ---- # define FEAT_SYSMOUSE #endif ! // urxvt is a small variation of mouse_xterm, and shares its code #if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM) # define FEAT_MOUSE_XTERM #endif /* * +clipboard Clipboard support. Always used for the GUI. * +xterm_clipboard Unix only: Include code for handling the clipboard *************** *** 1093,1099 **** * to check if mouse dragging can be used and if term * codes can be obtained. */ ! #if (defined(FEAT_NORMAL) || defined(FEAT_MOUSE)) && defined(HAVE_TGETENT) # define FEAT_TERMRESPONSE #endif --- 1076,1082 ---- * to check if mouse dragging can be used and if term * codes can be obtained. */ ! #if defined(HAVE_TGETENT) # define FEAT_TERMRESPONSE #endif *** ../vim-8.1.2170/src/edit.c 2019-10-09 22:52:48.996043767 +0200 --- src/edit.c 2019-10-17 22:37:31.211069983 +0200 *************** *** 235,241 **** conceal_check_cursor_line(); #endif - #ifdef FEAT_MOUSE /* * When doing a paste with the middle mouse button, Insstart is set to * where the paste started. --- 235,240 ---- *************** *** 243,249 **** if (where_paste_started.lnum != 0) Insstart = where_paste_started; else - #endif { Insstart = curwin->w_cursor; if (startln) --- 242,247 ---- *************** *** 336,342 **** */ if (restart_edit != 0 && stuff_empty()) { - #ifdef FEAT_MOUSE /* * After a paste we consider text typed to be part of the insert for * the pasted text. You can backspace over the pasted text too. --- 334,339 ---- *************** *** 344,350 **** if (where_paste_started.lnum) arrow_used = FALSE; else - #endif arrow_used = TRUE; restart_edit = 0; --- 341,346 ---- *************** *** 381,389 **** /* Need to save the line for undo before inserting the first char. */ ins_need_undo = TRUE; - #ifdef FEAT_MOUSE where_paste_started.lnum = 0; - #endif #ifdef FEAT_CINDENT can_cindent = TRUE; #endif --- 377,383 ---- *************** *** 980,986 **** inserted_space = FALSE; break; - #ifdef FEAT_MOUSE case K_LEFTMOUSE: /* mouse keys */ case K_LEFTMOUSE_NM: case K_LEFTDRAG: --- 974,979 ---- *************** *** 1017,1023 **** case K_MOUSERIGHT: /* Scroll wheel right */ ins_mousescroll(MSCR_RIGHT); break; ! #endif case K_PS: bracketed_paste(PASTE_INSERT, FALSE, NULL); if (cmdchar == K_PS) --- 1010,1016 ---- case K_MOUSERIGHT: /* Scroll wheel right */ ins_mousescroll(MSCR_RIGHT); break; ! case K_PS: bracketed_paste(PASTE_INSERT, FALSE, NULL); if (cmdchar == K_PS) *** ../vim-8.1.2170/src/evalfunc.c 2019-10-09 22:52:48.996043767 +0200 --- src/evalfunc.c 2019-10-17 22:37:43.139029799 +0200 *************** *** 815,823 **** #ifdef FEAT_GUI {"test_scrollbar", 3, 3, FEARG_2, f_test_scrollbar}, #endif - #ifdef FEAT_MOUSE {"test_setmouse", 2, 2, 0, f_test_setmouse}, - #endif {"test_settime", 1, 1, FEARG_1, f_test_settime}, #ifdef FEAT_TIMERS {"timer_info", 0, 1, FEARG_1, f_timer_info}, --- 815,821 ---- *************** *** 3433,3441 **** "mksession", #endif "modify_fname", - #ifdef FEAT_MOUSE "mouse", - #endif #ifdef FEAT_MOUSESHAPE "mouseshape", #endif --- 3431,3437 ---- *** ../vim-8.1.2170/src/ex_getln.c 2019-10-06 22:00:08.297244105 +0200 --- src/ex_getln.c 2019-10-17 22:38:21.446899060 +0200 *************** *** 795,805 **** int save_msg_scroll = msg_scroll; int save_State = State; /* remember State when called */ int some_key_typed = FALSE; /* one of the keys was typed */ - #ifdef FEAT_MOUSE /* mouse drag and release events are ignored, unless they are * preceded with a mouse down event */ int ignore_drag_release = TRUE; - #endif #ifdef FEAT_EVAL int break_ctrl_c = FALSE; #endif --- 795,803 ---- *************** *** 1856,1862 **** break; #endif - #ifdef FEAT_MOUSE case K_MIDDLEDRAG: case K_MIDDLERELEASE: goto cmdline_not_changed; /* Ignore mouse */ --- 1854,1859 ---- *************** *** 1961,1968 **** case K_MOUSEMOVE: goto cmdline_not_changed; - #endif /* FEAT_MOUSE */ - #ifdef FEAT_GUI case K_LEFTMOUSE_NM: /* mousefocus click, ignored */ case K_LEFTRELEASE_NM: --- 1958,1963 ---- *************** *** 2195,2203 **** case Ctrl_V: case Ctrl_Q: - #ifdef FEAT_MOUSE ignore_drag_release = TRUE; - #endif putcmdline('^', TRUE); c = get_literal(); /* get next (two) character(s) */ do_abbr = FALSE; /* don't do abbreviation now */ --- 2190,2196 ---- *************** *** 2213,2225 **** #ifdef FEAT_DIGRAPHS case Ctrl_K: - #ifdef FEAT_MOUSE ignore_drag_release = TRUE; - #endif putcmdline('?', TRUE); ! #ifdef USE_ON_FLY_SCROLL dont_scroll = TRUE; /* disallow scrolling here */ ! #endif c = get_digraph(TRUE); extra_char = NUL; if (c != NUL) --- 2206,2216 ---- #ifdef FEAT_DIGRAPHS case Ctrl_K: ignore_drag_release = TRUE; putcmdline('?', TRUE); ! # ifdef USE_ON_FLY_SCROLL dont_scroll = TRUE; /* disallow scrolling here */ ! # endif c = get_digraph(TRUE); extra_char = NUL; if (c != NUL) *************** *** 2227,2233 **** redrawcmd(); goto cmdline_not_changed; ! #endif /* FEAT_DIGRAPHS */ #ifdef FEAT_RIGHTLEFT case Ctrl__: /* CTRL-_: switch language mode */ --- 2218,2224 ---- redrawcmd(); goto cmdline_not_changed; ! #endif // FEAT_DIGRAPHS #ifdef FEAT_RIGHTLEFT case Ctrl__: /* CTRL-_: switch language mode */ *** ../vim-8.1.2170/src/getchar.c 2019-10-13 16:43:35.952359672 +0200 --- src/getchar.c 2019-10-17 22:39:12.690720271 +0200 *************** *** 1325,1334 **** 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. --- 1325,1332 ---- *************** *** 1559,1568 **** 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 { --- 1557,1564 ---- *************** *** 2007,2013 **** rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(temp); - #ifdef FEAT_MOUSE if (is_mouse_key(n)) { int row = mouse_row; --- 2003,2008 ---- *************** *** 2025,2035 **** if (win == NULL) return; (void)mouse_comp_pos(win, &row, &col, &lnum, NULL); ! # ifdef FEAT_TEXT_PROP if (WIN_IS_POPUP(win)) winnr = 0; else ! # endif for (wp = firstwin; wp != win && wp != NULL; wp = wp->w_next) ++winnr; --- 2020,2030 ---- if (win == NULL) return; (void)mouse_comp_pos(win, &row, &col, &lnum, NULL); ! #ifdef FEAT_TEXT_PROP if (WIN_IS_POPUP(win)) winnr = 0; else ! #endif for (wp = firstwin; wp != win && wp != NULL; wp = wp->w_next) ++winnr; *************** *** 2039,2045 **** set_vim_var_nr(VV_MOUSE_COL, col + 1); } } - #endif } } --- 2034,2039 ---- *************** *** 2636,2645 **** { old_char = c; old_mod_mask = mod_mask; - #ifdef FEAT_MOUSE old_mouse_row = mouse_row; old_mouse_col = mouse_col; - #endif } /* --- 2630,2637 ---- *** ../vim-8.1.2170/src/message.c 2019-10-14 22:01:54.004832028 +0200 --- src/message.c 2019-10-17 22:39:23.206683086 +0200 *************** *** 1200,1206 **** #ifdef FEAT_GUI || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR #endif - #ifdef FEAT_MOUSE || c == K_LEFTDRAG || c == K_LEFTRELEASE || c == K_MIDDLEDRAG || c == K_MIDDLERELEASE || c == K_RIGHTDRAG || c == K_RIGHTRELEASE --- 1200,1205 ---- *************** *** 1214,1232 **** || c == K_RIGHTMOUSE || c == K_X1MOUSE || c == K_X2MOUSE)) - #endif ); ui_breakcheck(); - #ifdef FEAT_MOUSE /* * Avoid that the mouse-up event causes visual mode to start. */ if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE || c == K_X1MOUSE || c == K_X2MOUSE) (void)jump_to_mouse(MOUSE_SETPOS, NULL, 0); ! else ! #endif ! if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C) { /* Put the character back in the typeahead buffer. Don't use the * stuff buffer, because lmaps wouldn't work. */ --- 1213,1227 ---- || c == K_RIGHTMOUSE || c == K_X1MOUSE || c == K_X2MOUSE)) ); ui_breakcheck(); /* * Avoid that the mouse-up event causes visual mode to start. */ if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE || c == K_X1MOUSE || c == K_X2MOUSE) (void)jump_to_mouse(MOUSE_SETPOS, NULL, 0); ! else if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C) { /* Put the character back in the typeahead buffer. Don't use the * stuff buffer, because lmaps wouldn't work. */ *** ../vim-8.1.2170/src/misc1.c 2019-10-09 22:52:49.000043746 +0200 --- src/misc1.c 2019-10-17 22:39:48.830591778 +0200 *************** *** 847,855 **** n = TO_SPECIAL(buf[1], buf[2]); if (buf[1] == KS_MODIFIER || n == K_IGNORE - #ifdef FEAT_MOUSE || (is_mouse_key(n) && n != K_LEFTMOUSE) - #endif #ifdef FEAT_GUI || n == K_VER_SCROLLBAR || n == K_HOR_SCROLLBAR --- 847,853 ---- *************** *** 929,942 **** } n /= 10; } - #ifdef FEAT_MOUSE else if (mouse_used != NULL && c == K_LEFTMOUSE) { *mouse_used = TRUE; n = mouse_row + 1; break; } - #endif else if (n == 0 && c == ':' && colon) { stuffcharReadbuff(':'); --- 927,938 ---- *** ../vim-8.1.2170/src/mouse.c 2019-09-23 21:16:51.387544361 +0200 --- src/mouse.c 2019-10-17 22:40:24.650462575 +0200 *************** *** 13,20 **** #include "vim.h" - #if defined(FEAT_MOUSE) || defined(PROTO) - /* * Get class of a character for selection: same class means same word. * 0: blank --- 13,18 ---- *************** *** 1258,1277 **** return (int)KE_IGNORE; // not recognized, ignore it } ! # ifdef FEAT_MOUSE_TTY ! # define HMT_NORMAL 1 ! # define HMT_NETTERM 2 ! # define HMT_DEC 4 ! # define HMT_JSBTERM 8 ! # define HMT_PTERM 16 ! # define HMT_URXVT 32 ! # define HMT_GPM 64 ! # define HMT_SGR 128 ! # define HMT_SGR_REL 256 static int has_mouse_termcode = 0; - # endif - # if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO) void set_mouse_termcode( int n, // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE --- 1256,1272 ---- return (int)KE_IGNORE; // not recognized, ignore it } ! # define HMT_NORMAL 1 ! # define HMT_NETTERM 2 ! # define HMT_DEC 4 ! # define HMT_JSBTERM 8 ! # define HMT_PTERM 16 ! # define HMT_URXVT 32 ! # define HMT_GPM 64 ! # define HMT_SGR 128 ! # define HMT_SGR_REL 256 static int has_mouse_termcode = 0; void set_mouse_termcode( int n, // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE *************** *** 1282,1288 **** name[0] = n; name[1] = KE_FILLER; add_termcode(name, s, FALSE); - # ifdef FEAT_MOUSE_TTY # ifdef FEAT_MOUSE_JSB if (n == KS_JSBTERM_MOUSE) has_mouse_termcode |= HMT_JSBTERM; --- 1277,1282 ---- *************** *** 1319,1330 **** has_mouse_termcode |= HMT_SGR_REL; else has_mouse_termcode |= HMT_NORMAL; - # endif } - # endif ! # if ((defined(UNIX) || defined(VMS)) \ ! && defined(FEAT_MOUSE_TTY)) || defined(PROTO) void del_mouse_termcode( int n) // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE --- 1313,1321 ---- has_mouse_termcode |= HMT_SGR_REL; else has_mouse_termcode |= HMT_NORMAL; } ! # if defined(UNIX) || defined(VMS) || defined(PROTO) void del_mouse_termcode( int n) // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE *************** *** 1334,1340 **** name[0] = n; name[1] = KE_FILLER; del_termcode(name); - # ifdef FEAT_MOUSE_TTY # ifdef FEAT_MOUSE_JSB if (n == KS_JSBTERM_MOUSE) has_mouse_termcode &= ~HMT_JSBTERM; --- 1325,1330 ---- *************** *** 1371,1377 **** has_mouse_termcode &= ~HMT_SGR_REL; else has_mouse_termcode &= ~HMT_NORMAL; - # endif } # endif --- 1361,1366 ---- *************** *** 1381,1395 **** void setmouse(void) { - # ifdef FEAT_MOUSE_TTY int checkfor; - # endif # ifdef FEAT_MOUSESHAPE update_mouseshape(-1); # endif ! # ifdef FEAT_MOUSE_TTY // Should be outside proc, but may break MOUSESHAPE # ifdef FEAT_GUI // In the GUI the mouse is always enabled. if (gui.in_use) --- 1370,1382 ---- void setmouse(void) { int checkfor; # ifdef FEAT_MOUSESHAPE update_mouseshape(-1); # endif ! // Should be outside proc, but may break MOUSESHAPE # ifdef FEAT_GUI // In the GUI the mouse is always enabled. if (gui.in_use) *************** *** 1423,1429 **** mch_setmouse(TRUE); else mch_setmouse(FALSE); - # endif } /* --- 1410,1415 ---- *************** *** 2289,2295 **** # endif ) { ! # if defined(UNIX) && defined(FEAT_MOUSE_TTY) if (use_xterm_mouse() > 1 && mouse_code >= 0x80) // mouse-move event, using MOUSE_DRAG works mouse_code = MOUSE_DRAG; --- 2275,2281 ---- # endif ) { ! # if defined(UNIX) if (use_xterm_mouse() > 1 && mouse_code >= 0x80) // mouse-move event, using MOUSE_DRAG works mouse_code = MOUSE_DRAG; *************** *** 2314,2320 **** } # endif ! # if defined(UNIX) && defined(FEAT_MOUSE_TTY) else if (use_xterm_mouse() > 1) { if (mouse_code & MOUSE_DRAG_XTERM) --- 2300,2306 ---- } # endif ! # if defined(UNIX) else if (use_xterm_mouse() > 1) { if (mouse_code & MOUSE_DRAG_XTERM) *************** *** 2810,2819 **** return 0; } - #endif // FEAT_MOUSE // Functions also used for popup windows. - #if defined(FEAT_MOUSE) || defined(FEAT_TEXT_PROP) || defined(PROTO) /* * Compute the buffer line position from the screen position "rowp" / "colp" in --- 2796,2803 ---- *************** *** 3017,3031 **** return (int)(ptr - line); } #endif - - #else // FEAT_MOUSE - - /* - * Dummy implementation of setmouse() to avoid lots of #ifdefs. - */ - void - setmouse(void) - { - } - - #endif // FEAT_MOUSE --- 3001,3003 ---- *** ../vim-8.1.2170/src/move.c 2019-08-25 22:24:58.871357010 +0200 --- src/move.c 2019-10-17 22:41:29.654223781 +0200 *************** *** 190,198 **** 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. */ --- 190,196 ---- *************** *** 209,219 **** 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 --- 207,215 ---- *************** *** 418,426 **** validate_cursor(); } - #ifdef FEAT_MOUSE *so_ptr = save_so; - #endif } /* --- 414,420 ---- *************** *** 1751,1760 **** linenr_T new_topline; int off = get_scrolloff_value(); - #ifdef FEAT_MOUSE if (mouse_dragging > 0) off = mouse_dragging - 1; - #endif /* * Decrease topline until: --- 1745,1752 ---- *************** *** 2004,2014 **** /* 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)) || boff.lnum + 1 > curbuf->b_ml.ml_line_count) && loff.lnum <= curwin->w_botline #ifdef FEAT_DIFF --- 1996,2002 ---- /* 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 >= (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,2060 **** 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) { extra += boff.height; if (boff.lnum >= curwin->w_botline --- 2038,2045 ---- used += boff.height; if (used > curwin->w_height) break; ! if (extra < ( mouse_dragging > 0 ? mouse_dragging - 1 : so) ! || scrolled < min_scroll) { extra += boff.height; if (boff.lnum >= curwin->w_botline *************** *** 2230,2242 **** */ 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; --- 2215,2225 ---- *************** *** 2246,2255 **** } validate_botline(); if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1 ! #ifdef FEAT_MOUSE ! && mouse_dragging == 0 ! #endif ! ) { below_wanted = 0; max_off = (curwin->w_height - 1) / 2; --- 2229,2235 ---- } validate_botline(); if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1 ! && mouse_dragging == 0) { below_wanted = 0; max_off = (curwin->w_height - 1) / 2; *** ../vim-8.1.2170/src/normal.c 2019-10-12 16:12:50.968492825 +0200 --- src/normal.c 2019-10-17 22:42:04.242094862 +0200 *************** *** 303,309 **** /* pound sign */ {POUND, nv_ident, 0, 0}, - #ifdef FEAT_MOUSE {K_MOUSEUP, nv_mousescroll, 0, MSCR_UP}, {K_MOUSEDOWN, nv_mousescroll, 0, MSCR_DOWN}, {K_MOUSELEFT, nv_mousescroll, 0, MSCR_LEFT}, --- 303,308 ---- *************** *** 326,332 **** {K_X2MOUSE, nv_mouse, 0, 0}, {K_X2DRAG, nv_mouse, 0, 0}, {K_X2RELEASE, nv_mouse, 0, 0}, - #endif {K_IGNORE, nv_ignore, NV_KEEPREG, 0}, {K_NOP, nv_nop, 0, 0}, {K_INS, nv_edit, 0, 0}, --- 325,330 ---- *************** *** 1319,1328 **** #endif VIsual_active = FALSE; - #ifdef FEAT_MOUSE setmouse(); mouse_dragging = 0; - #endif /* Save the current VIsual area for '< and '> marks, and "gv" */ curbuf->b_visual.vi_mode = VIsual_mode; --- 1317,1324 ---- *************** *** 1849,1862 **** int old_len; int extra_len; int overflow; - #if defined(FEAT_MOUSE) int i; static int ignore[] = { ! # ifdef FEAT_GUI K_VER_SCROLLBAR, K_HOR_SCROLLBAR, K_LEFTMOUSE_NM, K_LEFTRELEASE_NM, ! # endif K_IGNORE, K_PS, K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE, K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE, --- 1845,1857 ---- int old_len; int extra_len; int overflow; int i; static int ignore[] = { ! #ifdef FEAT_GUI K_VER_SCROLLBAR, K_HOR_SCROLLBAR, K_LEFTMOUSE_NM, K_LEFTRELEASE_NM, ! #endif K_IGNORE, K_PS, K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE, K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE, *************** *** 1866,1872 **** K_CURSORHOLD, 0 }; - #endif if (!p_sc || msg_silent != 0) return FALSE; --- 1861,1866 ---- *************** *** 1877,1889 **** showcmd_visual = FALSE; } - #if defined(FEAT_MOUSE) /* Ignore keys that are scrollbar updates and mouse clicks */ if (IS_SPECIAL(c)) for (i = 0; ignore[i] != 0; ++i) if (ignore[i] == c) return FALSE; - #endif p = transchar(c); if (*p == ' ') --- 1871,1881 ---- *************** *** 4625,4631 **** nv_cursormark(cap, cap->nchar == '\'', pos); } - #ifdef FEAT_MOUSE /* * [ or ] followed by a middle mouse click: put selected text with * indent adjustment. Any other button just does as usual. --- 4617,4622 ---- *************** *** 4636,4642 **** (cap->cmdchar == ']') ? FORWARD : BACKWARD, cap->count1, PUT_FIXINDENT); } - #endif /* FEAT_MOUSE */ #ifdef FEAT_FOLDING /* --- 4627,4632 ---- *************** *** 6220,6226 **** nv_gd(oap, cap->nchar, (int)cap->count0); break; - #ifdef FEAT_MOUSE /* * g<*Mouse> : */ --- 6210,6215 ---- *************** *** 6243,6249 **** mod_mask = MOD_MASK_CTRL; (void)do_mouse(oap, cap->nchar, BACKWARD, cap->count1, 0); break; - #endif case K_IGNORE: break; --- 6232,6237 ---- *** ../vim-8.1.2170/src/ops.c 2019-10-09 22:52:49.000043746 +0200 --- src/ops.c 2019-10-17 22:42:14.254057306 +0200 *************** *** 4369,4378 **** if (!gui_yank) { VIsual_active = FALSE; - #ifdef FEAT_MOUSE setmouse(); mouse_dragging = 0; - #endif may_clear_cmdline(); if ((oap->op_type == OP_YANK || oap->op_type == OP_COLON --- 4369,4376 ---- *** ../vim-8.1.2170/src/option.c 2019-10-13 16:43:35.960359646 +0200 --- src/option.c 2019-10-17 22:34:19.355676485 +0200 *************** *** 4976,4984 **** * outputting a few things that the terminal doesn't understand, but the * screen will be cleared later, so this is OK. */ ! #ifdef FEAT_MOUSE_TTY ! mch_setmouse(FALSE); /* switch mouse off */ ! #endif #ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); /* restore window titles */ #endif --- 4976,4982 ---- * outputting a few things that the terminal doesn't understand, but the * screen will be cleared later, so this is OK. */ ! mch_setmouse(FALSE); // switch mouse off #ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); /* restore window titles */ #endif *** ../vim-8.1.2170/src/optionstr.c 2019-10-13 16:59:05.157027519 +0200 --- src/optionstr.c 2019-10-17 22:42:55.933899867 +0200 *************** *** 47,53 **** #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL}; #endif ! #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL}; #endif static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL}; --- 47,53 ---- #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL}; #endif ! #if defined(UNIX) || defined(VMS) static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL}; #endif static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL}; *************** *** 110,116 **** (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE); (void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, FALSE); (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE); ! #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) (void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE); #endif #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) --- 110,116 ---- (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE); (void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, FALSE); (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE); ! #if defined(UNIX) || defined(VMS) (void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE); #endif #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) *************** *** 1588,1594 **** } #endif ! #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS)) // 'ttymouse' else if (varp == &p_ttym) { --- 1588,1594 ---- } #endif ! #if defined(UNIX) || defined(VMS) // 'ttymouse' else if (varp == &p_ttym) { *************** *** 2254,2265 **** #endif else if (varp == &p_mouse) // 'mouse' { - #ifdef FEAT_MOUSE p = (char_u *)MOUSE_ALL; - #else - if (*p_mouse != NUL) - errmsg = N_("E538: No mouse support"); - #endif } #if defined(FEAT_GUI) else if (varp == &p_go) // 'guioptions' --- 2254,2260 ---- *************** *** 2389,2408 **** #endif } - #ifdef FEAT_MOUSE if (varp == &p_mouse) { - # ifdef FEAT_MOUSE_TTY if (*p_mouse == NUL) mch_setmouse(FALSE); // switch mouse off else - # endif setmouse(); // in case 'mouse' changed } - #endif if (curwin->w_curswant != MAXCOL ! && (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0) curwin->w_set_curswant = TRUE; #ifdef FEAT_GUI --- 2384,2399 ---- #endif } if (varp == &p_mouse) { if (*p_mouse == NUL) mch_setmouse(FALSE); // switch mouse off else setmouse(); // in case 'mouse' changed } if (curwin->w_curswant != MAXCOL ! && (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0) curwin->w_set_curswant = TRUE; #ifdef FEAT_GUI *** ../vim-8.1.2170/src/os_unix.c 2019-09-16 21:05:21.127911692 +0200 --- src/os_unix.c 2019-10-17 22:35:44.755416663 +0200 *************** *** 2282,2288 **** } #endif - #if defined(FEAT_MOUSE_TTY) || defined(PROTO) /* * Return non-zero when using an xterm mouse, according to 'ttymouse'. * Return 1 for "xterm". --- 2282,2287 ---- *************** *** 2303,2309 **** return 1; return 0; } - #endif int vim_is_iris(char_u *name) --- 2302,2307 ---- *************** *** 3592,3598 **** #endif /* VMS */ - #if defined(FEAT_MOUSE_TTY) || defined(PROTO) static int mouse_ison = FALSE; /* --- 3590,3595 ---- *************** *** 3601,3629 **** void mch_setmouse(int on) { ! # ifdef FEAT_BEVAL_TERM static int bevalterm_ison = FALSE; ! # endif int xterm_mouse_vers; ! # if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) if (!on) // Make sure not tracing mouse movements. Important when a button-down // was received but no release yet. stop_xterm_trace(); ! # endif if (on == mouse_ison ! # ifdef FEAT_BEVAL_TERM && p_bevalterm == bevalterm_ison ! # endif ) /* return quickly if nothing to do */ return; xterm_mouse_vers = use_xterm_mouse(); ! # ifdef FEAT_MOUSE_URXVT if (ttym_flags == TTYM_URXVT) { out_str_nf((char_u *) --- 3598,3626 ---- void mch_setmouse(int on) { ! #ifdef FEAT_BEVAL_TERM static int bevalterm_ison = FALSE; ! #endif int xterm_mouse_vers; ! #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) if (!on) // Make sure not tracing mouse movements. Important when a button-down // was received but no release yet. stop_xterm_trace(); ! #endif if (on == mouse_ison ! #ifdef FEAT_BEVAL_TERM && p_bevalterm == bevalterm_ison ! #endif ) /* return quickly if nothing to do */ return; xterm_mouse_vers = use_xterm_mouse(); ! #ifdef FEAT_MOUSE_URXVT if (ttym_flags == TTYM_URXVT) { out_str_nf((char_u *) *************** *** 3632,3638 **** : IF_EB("\033[?1015l", ESC_STR "[?1015l"))); mouse_ison = on; } ! # endif if (ttym_flags == TTYM_SGR) { --- 3629,3635 ---- : IF_EB("\033[?1015l", ESC_STR "[?1015l"))); mouse_ison = on; } ! #endif if (ttym_flags == TTYM_SGR) { *************** *** 3644,3650 **** mouse_ison = on; } ! # ifdef FEAT_BEVAL_TERM if (bevalterm_ison != (p_bevalterm && on)) { bevalterm_ison = (p_bevalterm && on); --- 3641,3647 ---- mouse_ison = on; } ! #ifdef FEAT_BEVAL_TERM if (bevalterm_ison != (p_bevalterm && on)) { bevalterm_ison = (p_bevalterm && on); *************** *** 3653,3659 **** out_str_nf((char_u *) (IF_EB("\033[?1003l", ESC_STR "[?1003l"))); } ! # endif if (xterm_mouse_vers > 0) { --- 3650,3656 ---- out_str_nf((char_u *) (IF_EB("\033[?1003l", ESC_STR "[?1003l"))); } ! #endif if (xterm_mouse_vers > 0) { *************** *** 3661,3670 **** out_str_nf((char_u *) (xterm_mouse_vers > 1 ? ( ! # ifdef FEAT_BEVAL_TERM bevalterm_ison ? IF_EB("\033[?1003h", ESC_STR "[?1003h") : ! # endif IF_EB("\033[?1002h", ESC_STR "[?1002h")) : IF_EB("\033[?1000h", ESC_STR "[?1000h"))); else /* disable mouse events, could probably always send the same */ --- 3658,3667 ---- out_str_nf((char_u *) (xterm_mouse_vers > 1 ? ( ! #ifdef FEAT_BEVAL_TERM bevalterm_ison ? IF_EB("\033[?1003h", ESC_STR "[?1003h") : ! #endif IF_EB("\033[?1002h", ESC_STR "[?1002h")) : IF_EB("\033[?1000h", ESC_STR "[?1000h"))); else /* disable mouse events, could probably always send the same */ *************** *** 3675,3681 **** mouse_ison = on; } ! # ifdef FEAT_MOUSE_DEC else if (ttym_flags == TTYM_DEC) { if (on) /* enable mouse events */ --- 3672,3678 ---- mouse_ison = on; } ! #ifdef FEAT_MOUSE_DEC else if (ttym_flags == TTYM_DEC) { if (on) /* enable mouse events */ *************** *** 3684,3692 **** out_str_nf((char_u *)"\033['z"); mouse_ison = on; } ! # endif ! # ifdef FEAT_MOUSE_GPM else { if (on) --- 3681,3689 ---- out_str_nf((char_u *)"\033['z"); mouse_ison = on; } ! #endif ! #ifdef FEAT_MOUSE_GPM else { if (on) *************** *** 3700,3708 **** mouse_ison = FALSE; } } ! # endif ! # ifdef FEAT_SYSMOUSE else { if (on) --- 3697,3705 ---- mouse_ison = FALSE; } } ! #endif ! #ifdef FEAT_SYSMOUSE else { if (on) *************** *** 3716,3724 **** mouse_ison = FALSE; } } ! # endif ! # ifdef FEAT_MOUSE_JSB else { if (on) --- 3713,3721 ---- mouse_ison = FALSE; } } ! #endif ! #ifdef FEAT_MOUSE_JSB else { if (on) *************** *** 3738,3751 **** * 4 = Windows Cross Hair * 5 = Windows UP Arrow */ ! # ifdef JSBTERM_MOUSE_NONADVANCED /* Disables full feedback of pointer movements */ out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\", ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\")); ! # else out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\", ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\")); ! # endif mouse_ison = TRUE; } else --- 3735,3748 ---- * 4 = Windows Cross Hair * 5 = Windows UP Arrow */ ! # ifdef JSBTERM_MOUSE_NONADVANCED /* Disables full feedback of pointer movements */ out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\", ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\")); ! # else out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\", ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\")); ! # endif mouse_ison = TRUE; } else *************** *** 3755,3762 **** mouse_ison = FALSE; } } ! # endif ! # ifdef FEAT_MOUSE_PTERM else { /* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */ --- 3752,3759 ---- mouse_ison = FALSE; } } ! #endif ! #ifdef FEAT_MOUSE_PTERM else { /* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */ *************** *** 3766,3772 **** out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h"); mouse_ison = on; } ! # endif } #if defined(FEAT_BEVAL_TERM) || defined(PROTO) --- 3763,3769 ---- out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h"); mouse_ison = on; } ! #endif } #if defined(FEAT_BEVAL_TERM) || defined(PROTO) *************** *** 3929,3935 **** del_mouse_termcode(KS_SGR_MOUSE_RELEASE); } } - #endif /* * set screen mode, always fails. --- 3926,3931 ---- *** ../vim-8.1.2170/src/os_win32.c 2019-10-10 16:35:57.332930453 +0200 --- src/os_win32.c 2019-10-17 22:44:48.237467784 +0200 *************** *** 1127,1143 **** #endif /* FEAT_GUI_MSWIN */ - #ifdef FEAT_MOUSE - /* * For the GUI the mouse handling is in gui_w32.c. */ ! # if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL) void mch_setmouse(int on UNUSED) { } ! # else static int g_fMouseAvail = FALSE; /* mouse present */ static int g_fMouseActive = FALSE; /* mouse enabled */ static int g_nMouseClick = -1; /* mouse status */ --- 1127,1141 ---- #endif /* FEAT_GUI_MSWIN */ /* * For the GUI the mouse handling is in gui_w32.c. */ ! #if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL) void mch_setmouse(int on UNUSED) { } ! #else static int g_fMouseAvail = FALSE; /* mouse present */ static int g_fMouseActive = FALSE; /* mouse enabled */ static int g_nMouseClick = -1; /* mouse status */ *************** *** 1152,1161 **** { DWORD cmodein; ! # ifdef VIMDLL if (gui.in_use) return; ! # endif if (!g_fMouseAvail) return; --- 1150,1159 ---- { DWORD cmodein; ! # ifdef VIMDLL if (gui.in_use) return; ! # endif if (!g_fMouseAvail) return; *************** *** 1171,1177 **** } ! #if defined(FEAT_BEVAL_TERM) || defined(PROTO) /* * Called when 'balloonevalterm' changed. */ --- 1169,1175 ---- } ! # if defined(FEAT_BEVAL_TERM) || defined(PROTO) /* * Called when 'balloonevalterm' changed. */ *************** *** 1180,1186 **** { mch_setmouse(g_fMouseActive); } ! #endif /* * Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT, --- 1178,1184 ---- { mch_setmouse(g_fMouseActive); } ! # endif /* * Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT, *************** *** 1218,1226 **** static int s_xOldMouse = -1; static int s_yOldMouse = -1; static linenr_T s_old_topline = 0; ! #ifdef FEAT_DIFF static int s_old_topfill = 0; ! #endif static int s_cClicks = 1; static BOOL s_fReleased = TRUE; static DWORD s_dwLastClickTime = 0; --- 1216,1224 ---- static int s_xOldMouse = -1; static int s_yOldMouse = -1; static linenr_T s_old_topline = 0; ! # ifdef FEAT_DIFF static int s_old_topfill = 0; ! # endif static int s_cClicks = 1; static BOOL s_fReleased = TRUE; static DWORD s_dwLastClickTime = 0; *************** *** 1275,1286 **** /* If the last thing returned was MOUSE_RELEASE, ignore this */ if (s_fReleased) { ! #ifdef FEAT_BEVAL_TERM /* do return mouse move events when we want them */ if (p_bevalterm) nButton = MOUSE_DRAG; else ! #endif return FALSE; } --- 1273,1284 ---- /* If the last thing returned was MOUSE_RELEASE, ignore this */ if (s_fReleased) { ! # ifdef FEAT_BEVAL_TERM /* do return mouse move events when we want them */ if (p_bevalterm) nButton = MOUSE_DRAG; else ! # endif return FALSE; } *************** *** 1386,1394 **** || s_yOldMouse != g_yMouse || s_nOldButton != nButton || s_old_topline != curwin->w_topline ! #ifdef FEAT_DIFF || s_old_topfill != curwin->w_topfill ! #endif || (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset) { s_cClicks = 1; --- 1384,1392 ---- || s_yOldMouse != g_yMouse || s_nOldButton != nButton || s_old_topline != curwin->w_topline ! # ifdef FEAT_DIFF || s_old_topfill != curwin->w_topfill ! # endif || (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset) { s_cClicks = 1; *************** *** 1439,1454 **** s_xOldMouse = g_xMouse; s_yOldMouse = g_yMouse; s_old_topline = curwin->w_topline; ! #ifdef FEAT_DIFF s_old_topfill = curwin->w_topfill; ! #endif s_nOldMouseClick = g_nMouseClick; return TRUE; } ! # endif /* FEAT_GUI_MSWIN */ ! #endif /* FEAT_MOUSE */ #ifdef MCH_CURSOR_SHAPE --- 1437,1451 ---- s_xOldMouse = g_xMouse; s_yOldMouse = g_yMouse; s_old_topline = curwin->w_topline; ! # ifdef FEAT_DIFF s_old_topfill = curwin->w_topfill; ! # endif s_nOldMouseClick = g_nMouseClick; return TRUE; } ! #endif // FEAT_GUI_MSWIN #ifdef MCH_CURSOR_SHAPE *************** *** 1547,1556 **** #endif } ! if (0 ! #ifdef FEAT_MOUSE ! || g_nMouseClick != -1 ! #endif #ifdef FEAT_CLIENTSERVER || (!ignore_input && input_available()) #endif --- 1544,1550 ---- #endif } ! if (g_nMouseClick != -1 #ifdef FEAT_CLIENTSERVER || (!ignore_input && input_available()) #endif *************** *** 1683,1693 **** shell_resized(); } } - #ifdef FEAT_MOUSE else if (ir.EventType == MOUSE_EVENT && decode_mouse_event(&ir.Event.MouseEvent)) return TRUE; - #endif } else if (msec == 0) break; --- 1677,1685 ---- *************** *** 1760,1769 **** (void)WaitForChar(-1L, FALSE); if (input_available()) return 0; - # ifdef FEAT_MOUSE if (g_nMouseClick != -1) return 0; - # endif #endif if (read_console_input(g_hConIn, &ir, 1, &cRecords) == 0) { --- 1752,1759 ---- *************** *** 1783,1795 **** handle_focus_event(ir); else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT) shell_resized(); - #ifdef FEAT_MOUSE else if (ir.EventType == MOUSE_EVENT) { if (decode_mouse_event(&ir.Event.MouseEvent)) return 0; } - #endif } } #endif /* !FEAT_GUI_MSWIN */ --- 1773,1783 ---- *************** *** 1879,1892 **** typeaheadlen = 0; break; } - #ifdef FEAT_MOUSE if (g_nMouseClick != -1) { ! # ifdef MCH_WRITE_DUMP if (fdDump) fprintf(fdDump, "{%02x @ %d, %d}", g_nMouseClick, g_xMouse, g_yMouse); ! # endif typeahead[typeaheadlen++] = ESC + 128; typeahead[typeaheadlen++] = 'M'; typeahead[typeaheadlen++] = g_nMouseClick; --- 1867,1879 ---- typeaheadlen = 0; break; } if (g_nMouseClick != -1) { ! #ifdef MCH_WRITE_DUMP if (fdDump) fprintf(fdDump, "{%02x @ %d, %d}", g_nMouseClick, g_xMouse, g_yMouse); ! #endif typeahead[typeaheadlen++] = ESC + 128; typeahead[typeaheadlen++] = 'M'; typeahead[typeaheadlen++] = g_nMouseClick; *************** *** 1895,1901 **** g_nMouseClick = -1; } else - #endif { WCHAR ch2 = NUL; int modifiers = 0; --- 1882,1887 ---- *************** *** 1918,1926 **** got_int = TRUE; } - #ifdef FEAT_MOUSE if (g_nMouseClick == -1) - #endif { int n = 1; --- 1904,1910 ---- *************** *** 2675,2683 **** g_fWindInitCalled = TRUE; - #ifdef FEAT_MOUSE g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); - #endif #ifdef FEAT_CLIPBOARD win_clip_init(); --- 2659,2665 ---- *************** *** 3609,3618 **** { cmodein &= ~(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT); - #ifdef FEAT_MOUSE if (g_fMouseActive) cmodein |= ENABLE_MOUSE_INPUT; - #endif cmodeout &= ~( #ifdef FEAT_TERMGUICOLORS /* Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using --- 3591,3598 ---- *************** *** 5501,5512 **** #endif GetConsoleMode(g_hConIn, &cmodein); - #ifdef FEAT_MOUSE if (g_fMouseActive) cmodein |= ENABLE_MOUSE_INPUT; else cmodein &= ~ENABLE_MOUSE_INPUT; - #endif cmodein |= ENABLE_WINDOW_INPUT; SetConsoleMode(g_hConIn, cmodein); --- 5481,5490 ---- *** ../vim-8.1.2170/src/register.c 2019-09-25 22:36:57.300103046 +0200 --- src/register.c 2019-10-17 22:45:00.001421924 +0200 *************** *** 352,358 **** } #endif - #if defined(FEAT_MOUSE) || defined(PROTO) /* * return TRUE if the current yank register has type MLINE */ --- 352,357 ---- *************** *** 366,372 **** get_yank_register(regname, FALSE); return (y_current->y_type == MLINE); } - #endif /* * Start or stop recording into a yank register. --- 365,370 ---- *** ../vim-8.1.2170/src/term.c 2019-10-17 22:16:46.589005478 +0200 --- src/term.c 2019-10-17 22:46:07.213157793 +0200 *************** *** 1962,1970 **** is_mac_terminal = FALSE; #endif ! #ifdef FEAT_MOUSE ! # if defined(UNIX) || defined(VMS) ! # ifdef FEAT_MOUSE_TTY /* * For Unix, set the 'ttymouse' option to the type of mouse to be used. * The termcode for the mouse is added as a side effect in option.c. --- 1962,1968 ---- is_mac_terminal = FALSE; #endif ! #if defined(UNIX) || defined(VMS) /* * For Unix, set the 'ttymouse' option to the type of mouse to be used. * The termcode for the mouse is added as a side effect in option.c. *************** *** 1972,1978 **** { char_u *p = (char_u *)""; ! # ifdef FEAT_MOUSE_XTERM if (use_xterm_like_mouse(term)) { if (use_xterm_mouse()) --- 1970,1976 ---- { char_u *p = (char_u *)""; ! # ifdef FEAT_MOUSE_XTERM if (use_xterm_like_mouse(term)) { if (use_xterm_mouse()) *************** *** 1980,1986 **** else p = (char_u *)"xterm"; } ! # endif if (p != NULL) { set_option_value((char_u *)"ttym", 0L, p, 0); --- 1978,1984 ---- else p = (char_u *)"xterm"; } ! # endif if (p != NULL) { set_option_value((char_u *)"ttym", 0L, p, 0); *************** *** 1989,2005 **** reset_option_was_set((char_u *)"ttym"); } if (p == NULL ! # ifdef FEAT_GUI || gui.in_use ! # endif ) check_mouse_termcode(); /* set mouse termcode anyway */ } ! # endif ! # else set_mouse_termcode(KS_MOUSE, (char_u *)"\233M"); ! # endif ! #endif /* FEAT_MOUSE */ #ifdef USE_TERM_CONSOLE /* DEFAULT_TERM indicates that it is the machine console. */ --- 1987,2001 ---- reset_option_was_set((char_u *)"ttym"); } if (p == NULL ! # ifdef FEAT_GUI || gui.in_use ! # endif ) check_mouse_termcode(); /* set mouse termcode anyway */ } ! #else set_mouse_termcode(KS_MOUSE, (char_u *)"\233M"); ! #endif #ifdef USE_TERM_CONSOLE /* DEFAULT_TERM indicates that it is the machine console. */ *************** *** 2565,2572 **** out_flush(); } - #if defined(FEAT_TITLE) || defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI) \ - || defined(FEAT_TERMRESPONSE) || defined(PROTO) /* * A never-padding out_str. * use this whenever you don't want to run the string through tputs. --- 2561,2566 ---- *************** *** 2590,2596 **** if (p_wd) out_flush(); } - #endif /* * A conditional-flushing out_str, mainly for visualbell. --- 2584,2589 ---- *************** *** 3151,3159 **** } #endif - #if defined(FEAT_GUI) \ - || (defined(FEAT_MOUSE) && (!defined(UNIX) || defined(FEAT_MOUSE_XTERM) \ - || defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE))) /* * Read the next num_bytes bytes from buf, and store them in bytes. Assume * that buf has been through inchar(). Returns the actual number of bytes used --- 3144,3149 ---- *************** *** 3191,3197 **** } return len; } - #endif /* * Check if the new shell size is valid, correct it if it's too small or way --- 3181,3186 ---- *************** *** 3436,3445 **** check_for_codes_from_term(); } #endif - #ifdef FEAT_MOUSE_TTY if (tmode != TMODE_RAW) mch_setmouse(FALSE); // switch mouse off - #endif if (termcap_active) { if (tmode != TMODE_RAW) --- 3425,3432 ---- *************** *** 5084,5091 **** /* We only get here when we have a complete termcode match */ ! #ifdef FEAT_MOUSE ! # ifdef FEAT_GUI /* * Only in the GUI: Fetch the pointer coordinates of the scroll event * so that we know which window to scroll later. --- 5071,5077 ---- /* We only get here when we have a complete termcode match */ ! #ifdef FEAT_GUI /* * Only in the GUI: Fetch the pointer coordinates of the scroll event * so that we know which window to scroll later. *************** *** 5109,5137 **** slen += num_bytes; } else ! # endif /* * If it is a mouse click, get the coordinates. */ if (key_name[0] == KS_MOUSE ! # ifdef FEAT_MOUSE_GPM || key_name[0] == KS_GPM_MOUSE ! # endif ! # ifdef FEAT_MOUSE_JSB || key_name[0] == KS_JSBTERM_MOUSE ! # endif ! # ifdef FEAT_MOUSE_NET || key_name[0] == KS_NETTERM_MOUSE ! # endif ! # ifdef FEAT_MOUSE_DEC || key_name[0] == KS_DEC_MOUSE ! # endif ! # ifdef FEAT_MOUSE_PTERM || key_name[0] == KS_PTERM_MOUSE ! # endif ! # ifdef FEAT_MOUSE_URXVT || key_name[0] == KS_URXVT_MOUSE ! # endif || key_name[0] == KS_SGR_MOUSE || key_name[0] == KS_SGR_MOUSE_RELEASE) { --- 5095,5123 ---- slen += num_bytes; } else ! #endif /* * If it is a mouse click, get the coordinates. */ if (key_name[0] == KS_MOUSE ! #ifdef FEAT_MOUSE_GPM || key_name[0] == KS_GPM_MOUSE ! #endif ! #ifdef FEAT_MOUSE_JSB || key_name[0] == KS_JSBTERM_MOUSE ! #endif ! #ifdef FEAT_MOUSE_NET || key_name[0] == KS_NETTERM_MOUSE ! #endif ! #ifdef FEAT_MOUSE_DEC || key_name[0] == KS_DEC_MOUSE ! #endif ! #ifdef FEAT_MOUSE_PTERM || key_name[0] == KS_PTERM_MOUSE ! #endif ! #ifdef FEAT_MOUSE_URXVT || key_name[0] == KS_URXVT_MOUSE ! #endif || key_name[0] == KS_SGR_MOUSE || key_name[0] == KS_SGR_MOUSE_RELEASE) { *************** *** 5139,5145 **** &modifiers) == -1) return -1; } - #endif /* FEAT_MOUSE */ #ifdef FEAT_GUI /* --- 5125,5130 ---- *** ../vim-8.1.2170/src/testing.c 2019-07-14 14:55:20.372881409 +0200 --- src/testing.c 2019-10-17 22:46:20.049106985 +0200 *************** *** 926,939 **** } #endif - #ifdef FEAT_MOUSE void f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED) { mouse_row = (time_t)tv_get_number(&argvars[0]) - 1; mouse_col = (time_t)tv_get_number(&argvars[1]) - 1; } - #endif void f_test_settime(typval_T *argvars, typval_T *rettv UNUSED) --- 926,937 ---- *** ../vim-8.1.2170/src/window.c 2019-10-11 21:19:10.397931898 +0200 --- src/window.c 2019-10-17 22:47:00.952944366 +0200 *************** *** 5725,5732 **** } } - #if defined(FEAT_MOUSE) || defined(PROTO) - /* * Status line of dragwin is dragged "offset" lines down (negative is up). */ --- 5725,5730 ---- *************** *** 5958,5964 **** (void)win_comp_pos(); redraw_all_later(NOT_VALID); } - #endif /* FEAT_MOUSE */ #define FRACTION_MULT 16384L --- 5956,5961 ---- *** ../vim-8.1.2170/src/globals.h 2019-10-13 16:43:35.952359672 +0200 --- src/globals.h 2019-10-17 22:47:39.156791545 +0200 *************** *** 470,476 **** EXTERN buf_T *au_pending_free_buf INIT(= NULL); EXTERN win_T *au_pending_free_win INIT(= NULL); - #ifdef FEAT_MOUSE /* * Mouse coordinates, set by check_termcode() */ --- 470,475 ---- *************** *** 480,494 **** EXTERN int mouse_past_eol INIT(= FALSE); // mouse right of line EXTERN int mouse_dragging INIT(= 0); // extending Visual area with // mouse dragging ! # if defined(FEAT_MOUSE_DEC) /* * When the DEC mouse has been pressed but not yet released we enable * automatic queries for the mouse position. */ EXTERN int WantQueryMouse INIT(= FALSE); ! # endif ! # ifdef FEAT_GUI // When the window layout is about to be changed, need_mouse_correct is set, // so that gui_mouse_correct() is called afterwards, to correct the mouse // pointer when focus-follow-mouse is being used. --- 479,493 ---- EXTERN int mouse_past_eol INIT(= FALSE); // mouse right of line EXTERN int mouse_dragging INIT(= 0); // extending Visual area with // mouse dragging ! #if defined(FEAT_MOUSE_DEC) /* * When the DEC mouse has been pressed but not yet released we enable * automatic queries for the mouse position. */ EXTERN int WantQueryMouse INIT(= FALSE); ! #endif ! #ifdef FEAT_GUI // When the window layout is about to be changed, need_mouse_correct is set, // so that gui_mouse_correct() is called afterwards, to correct the mouse // pointer when focus-follow-mouse is being used. *************** *** 496,505 **** // When double clicking, topline must be the same EXTERN linenr_T gui_prev_topline INIT(= 0); ! # ifdef FEAT_DIFF EXTERN int gui_prev_topfill INIT(= 0); - # endif # endif # ifdef FEAT_MOUSESHAPE EXTERN int drag_status_line INIT(= FALSE); // dragging the status line --- 495,504 ---- // When double clicking, topline must be the same EXTERN linenr_T gui_prev_topline INIT(= 0); ! # ifdef FEAT_DIFF EXTERN int gui_prev_topfill INIT(= 0); # endif + #endif # ifdef FEAT_MOUSESHAPE EXTERN int drag_status_line INIT(= FALSE); // dragging the status line *************** *** 508,514 **** EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator # endif - #endif #ifdef FEAT_DIFF // Value set from 'diffopt'. --- 507,512 ---- *************** *** 785,797 **** EXTERN linenr_T resel_VIsual_line_count; // number of lines EXTERN colnr_T resel_VIsual_vcol; // nr of cols or end col - #ifdef FEAT_MOUSE /* * When pasting text with the middle mouse button in visual mode with * restart_edit set, remember where it started so we can set Insstart. */ EXTERN pos_T where_paste_started; - #endif /* * This flag is used to make auto-indent work right on lines where only a --- 783,793 ---- *** ../vim-8.1.2170/src/option.h 2019-09-28 19:04:06.997029566 +0200 --- src/option.h 2019-10-17 22:47:48.792752863 +0200 *************** *** 979,985 **** # define TBIS_GIANT 0x20 #endif EXTERN long p_ttyscroll; // 'ttyscroll' ! #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) EXTERN char_u *p_ttym; // 'ttymouse' EXTERN unsigned ttym_flags; # define TTYM_XTERM 0x01 --- 979,985 ---- # define TBIS_GIANT 0x20 #endif EXTERN long p_ttyscroll; // 'ttyscroll' ! #if defined(UNIX) || defined(VMS) EXTERN char_u *p_ttym; // 'ttymouse' EXTERN unsigned ttym_flags; # define TTYM_XTERM 0x01 *** ../vim-8.1.2170/src/optiondefs.h 2019-10-12 21:08:37.002660427 +0200 --- src/optiondefs.h 2019-10-17 22:48:09.036671462 +0200 *************** *** 2655,2661 **** (char_u *)&p_tf, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF, ! #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) (char_u *)&p_ttym, PV_NONE, #else (char_u *)NULL, PV_NONE, --- 2655,2661 ---- (char_u *)&p_tf, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF, ! #if defined(UNIX) || defined(VMS) (char_u *)&p_ttym, PV_NONE, #else (char_u *)NULL, PV_NONE, *** ../vim-8.1.2170/src/os_win32.h 2019-05-09 15:12:45.176723907 +0200 --- src/os_win32.h 2019-10-17 22:48:35.908563004 +0200 *************** *** 62,68 **** #endif #define USE_FNAME_CASE /* adjust case of file names */ ! #if !defined(FEAT_CLIPBOARD) && defined(FEAT_MOUSE) # define FEAT_CLIPBOARD /* include clipboard support */ #endif #if defined(__DATE__) && defined(__TIME__) --- 62,68 ---- #endif #define USE_FNAME_CASE /* adjust case of file names */ ! #if !defined(FEAT_CLIPBOARD) # define FEAT_CLIPBOARD /* include clipboard support */ #endif #if defined(__DATE__) && defined(__TIME__) *** ../vim-8.1.2170/src/vim.h 2019-10-13 16:43:35.960359646 +0200 --- src/vim.h 2019-10-17 22:49:32.356334130 +0200 *************** *** 151,159 **** # if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD) # define FEAT_CLIPBOARD # endif - # if defined(FEAT_SMALL) && !defined(FEAT_MOUSE) - # define FEAT_MOUSE - # endif #endif // +x11 is only enabled when it's both available and wanted. --- 151,156 ---- *************** *** 1817,1896 **** #define PROF_YES 1 // profiling busy #define PROF_PAUSED 2 // profiling paused - #ifdef FEAT_MOUSE // Codes for mouse button events in lower three bits: ! # define MOUSE_LEFT 0x00 ! # define MOUSE_MIDDLE 0x01 ! # define MOUSE_RIGHT 0x02 ! # define MOUSE_RELEASE 0x03 // bit masks for modifiers: ! # define MOUSE_SHIFT 0x04 ! # define MOUSE_ALT 0x08 ! # define MOUSE_CTRL 0x10 // mouse buttons that are handled like a key press (GUI only) // Note that the scroll wheel keys are inverted: MOUSE_5 scrolls lines up but // the result of this is that the window moves down, similarly MOUSE_6 scrolls // columns left but the window moves right. ! # define MOUSE_4 0x100 // scroll wheel down ! # define MOUSE_5 0x200 // scroll wheel up ! # define MOUSE_X1 0x300 // Mouse-button X1 (6th) ! # define MOUSE_X2 0x400 // Mouse-button X2 ! # define MOUSE_6 0x500 // scroll wheel left ! # define MOUSE_7 0x600 // scroll wheel right // 0x20 is reserved by xterm ! # define MOUSE_DRAG_XTERM 0x40 ! # define MOUSE_DRAG (0x40 | MOUSE_RELEASE) // Lowest button code for using the mouse wheel (xterm only) ! # define MOUSEWHEEL_LOW 0x60 ! # define MOUSE_CLICK_MASK 0x03 ! # define NUM_MOUSE_CLICKS(code) \ (((unsigned)((code) & 0xC0) >> 6) + 1) ! # define SET_NUM_MOUSE_CLICKS(code, num) \ (code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6) // Added to mouse column for GUI when 'mousefocus' wants to give focus to a // window by simulating a click on its status line. We could use up to 128 * // 128 = 16384 columns, now it's reduced to 10000. ! # define MOUSE_COLOFF 10000 /* * jump_to_mouse() returns one of first four these values, possibly with * some of the other three added. */ ! # define IN_UNKNOWN 0 ! # define IN_BUFFER 1 ! # define IN_STATUS_LINE 2 // on status or command line ! # define IN_SEP_LINE 4 // on vertical separator line ! # define IN_OTHER_WIN 8 // in other window but can't go there ! # define CURSOR_MOVED 0x100 ! # define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column ! # define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column ! # define MOUSE_WINBAR 0x800 // in window toolbar // flags for jump_to_mouse() ! # define MOUSE_FOCUS 0x01 // need to stay in this window ! # define MOUSE_MAY_VIS 0x02 // may start Visual mode ! # define MOUSE_DID_MOVE 0x04 // only act when mouse has moved ! # define MOUSE_SETPOS 0x08 // only set current mouse position ! # define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode ! # define MOUSE_RELEASED 0x20 // button was released ! # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) ! # define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves. ! # endif - #endif // FEAT_MOUSE // defines for eval_vars() #define VALID_PATH 1 --- 1814,1891 ---- #define PROF_YES 1 // profiling busy #define PROF_PAUSED 2 // profiling paused // Codes for mouse button events in lower three bits: ! #define MOUSE_LEFT 0x00 ! #define MOUSE_MIDDLE 0x01 ! #define MOUSE_RIGHT 0x02 ! #define MOUSE_RELEASE 0x03 // bit masks for modifiers: ! #define MOUSE_SHIFT 0x04 ! #define MOUSE_ALT 0x08 ! #define MOUSE_CTRL 0x10 // mouse buttons that are handled like a key press (GUI only) // Note that the scroll wheel keys are inverted: MOUSE_5 scrolls lines up but // the result of this is that the window moves down, similarly MOUSE_6 scrolls // columns left but the window moves right. ! #define MOUSE_4 0x100 // scroll wheel down ! #define MOUSE_5 0x200 // scroll wheel up ! #define MOUSE_X1 0x300 // Mouse-button X1 (6th) ! #define MOUSE_X2 0x400 // Mouse-button X2 ! #define MOUSE_6 0x500 // scroll wheel left ! #define MOUSE_7 0x600 // scroll wheel right // 0x20 is reserved by xterm ! #define MOUSE_DRAG_XTERM 0x40 ! #define MOUSE_DRAG (0x40 | MOUSE_RELEASE) // Lowest button code for using the mouse wheel (xterm only) ! #define MOUSEWHEEL_LOW 0x60 ! #define MOUSE_CLICK_MASK 0x03 ! #define NUM_MOUSE_CLICKS(code) \ (((unsigned)((code) & 0xC0) >> 6) + 1) ! #define SET_NUM_MOUSE_CLICKS(code, num) \ (code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6) // Added to mouse column for GUI when 'mousefocus' wants to give focus to a // window by simulating a click on its status line. We could use up to 128 * // 128 = 16384 columns, now it's reduced to 10000. ! #define MOUSE_COLOFF 10000 /* * jump_to_mouse() returns one of first four these values, possibly with * some of the other three added. */ ! #define IN_UNKNOWN 0 ! #define IN_BUFFER 1 ! #define IN_STATUS_LINE 2 // on status or command line ! #define IN_SEP_LINE 4 // on vertical separator line ! #define IN_OTHER_WIN 8 // in other window but can't go there ! #define CURSOR_MOVED 0x100 ! #define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column ! #define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column ! #define MOUSE_WINBAR 0x800 // in window toolbar // flags for jump_to_mouse() ! #define MOUSE_FOCUS 0x01 // need to stay in this window ! #define MOUSE_MAY_VIS 0x02 // may start Visual mode ! #define MOUSE_DID_MOVE 0x04 // only act when mouse has moved ! #define MOUSE_SETPOS 0x08 // only set current mouse position ! #define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode ! #define MOUSE_RELEASED 0x20 // button was released ! #if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) ! # define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves. ! #endif // defines for eval_vars() #define VALID_PATH 1 *** ../vim-8.1.2170/src/version.c 2019-10-17 22:16:46.589005478 +0200 --- src/version.c 2019-10-17 22:51:08.323941984 +0200 *************** *** 359,373 **** "-mksession", #endif "+modify_fname", - #ifdef FEAT_MOUSE "+mouse", ! # ifdef FEAT_MOUSESHAPE "+mouseshape", ! # else "-mouseshape", - # endif - # else - "-mouse", #endif #if defined(UNIX) || defined(VMS) --- 359,369 ---- "-mksession", #endif "+modify_fname", "+mouse", ! #ifdef FEAT_MOUSESHAPE "+mouseshape", ! #else "-mouseshape", #endif #if defined(UNIX) || defined(VMS) *************** *** 402,412 **** #endif #if defined(UNIX) || defined(VMS) - # ifdef FEAT_MOUSE_XTERM "+mouse_sgr", - # else - "-mouse_sgr", - # endif # ifdef FEAT_SYSMOUSE "+mouse_sysmouse", # else --- 398,404 ---- *************** *** 417,427 **** # else "-mouse_urxvt", # endif - # ifdef FEAT_MOUSE_XTERM "+mouse_xterm", - # else - "-mouse_xterm", - # endif #endif #ifdef FEAT_MBYTE_IME --- 409,415 ---- *** ../vim-8.1.2170/src/version.c 2019-10-17 22:16:46.589005478 +0200 --- src/version.c 2019-10-17 22:51:08.323941984 +0200 *************** *** 755,756 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2171, /**/ -- FATAL ERROR! SYSTEM HALTED! - Press any key to continue doing nothing. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///