mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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).
This commit is contained in:
parent
0d2c4bf171
commit
a1cb1d1dce
@ -235,7 +235,6 @@ edit(
|
|||||||
conceal_check_cursor_line();
|
conceal_check_cursor_line();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* When doing a paste with the middle mouse button, Insstart is set to
|
* When doing a paste with the middle mouse button, Insstart is set to
|
||||||
* where the paste started.
|
* where the paste started.
|
||||||
@ -243,7 +242,6 @@ edit(
|
|||||||
if (where_paste_started.lnum != 0)
|
if (where_paste_started.lnum != 0)
|
||||||
Insstart = where_paste_started;
|
Insstart = where_paste_started;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
Insstart = curwin->w_cursor;
|
Insstart = curwin->w_cursor;
|
||||||
if (startln)
|
if (startln)
|
||||||
@ -336,7 +334,6 @@ edit(
|
|||||||
*/
|
*/
|
||||||
if (restart_edit != 0 && stuff_empty())
|
if (restart_edit != 0 && stuff_empty())
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* After a paste we consider text typed to be part of the insert for
|
* 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.
|
* the pasted text. You can backspace over the pasted text too.
|
||||||
@ -344,7 +341,6 @@ edit(
|
|||||||
if (where_paste_started.lnum)
|
if (where_paste_started.lnum)
|
||||||
arrow_used = FALSE;
|
arrow_used = FALSE;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
arrow_used = TRUE;
|
arrow_used = TRUE;
|
||||||
restart_edit = 0;
|
restart_edit = 0;
|
||||||
|
|
||||||
@ -381,9 +377,7 @@ edit(
|
|||||||
/* Need to save the line for undo before inserting the first char. */
|
/* Need to save the line for undo before inserting the first char. */
|
||||||
ins_need_undo = TRUE;
|
ins_need_undo = TRUE;
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
where_paste_started.lnum = 0;
|
where_paste_started.lnum = 0;
|
||||||
#endif
|
|
||||||
#ifdef FEAT_CINDENT
|
#ifdef FEAT_CINDENT
|
||||||
can_cindent = TRUE;
|
can_cindent = TRUE;
|
||||||
#endif
|
#endif
|
||||||
@ -980,7 +974,6 @@ doESCkey:
|
|||||||
inserted_space = FALSE;
|
inserted_space = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
case K_LEFTMOUSE: /* mouse keys */
|
case K_LEFTMOUSE: /* mouse keys */
|
||||||
case K_LEFTMOUSE_NM:
|
case K_LEFTMOUSE_NM:
|
||||||
case K_LEFTDRAG:
|
case K_LEFTDRAG:
|
||||||
@ -1017,7 +1010,7 @@ doESCkey:
|
|||||||
case K_MOUSERIGHT: /* Scroll wheel right */
|
case K_MOUSERIGHT: /* Scroll wheel right */
|
||||||
ins_mousescroll(MSCR_RIGHT);
|
ins_mousescroll(MSCR_RIGHT);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case K_PS:
|
case K_PS:
|
||||||
bracketed_paste(PASTE_INSERT, FALSE, NULL);
|
bracketed_paste(PASTE_INSERT, FALSE, NULL);
|
||||||
if (cmdchar == K_PS)
|
if (cmdchar == K_PS)
|
||||||
|
@ -815,9 +815,7 @@ static funcentry_T global_functions[] =
|
|||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
{"test_scrollbar", 3, 3, FEARG_2, f_test_scrollbar},
|
{"test_scrollbar", 3, 3, FEARG_2, f_test_scrollbar},
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
{"test_setmouse", 2, 2, 0, f_test_setmouse},
|
{"test_setmouse", 2, 2, 0, f_test_setmouse},
|
||||||
#endif
|
|
||||||
{"test_settime", 1, 1, FEARG_1, f_test_settime},
|
{"test_settime", 1, 1, FEARG_1, f_test_settime},
|
||||||
#ifdef FEAT_TIMERS
|
#ifdef FEAT_TIMERS
|
||||||
{"timer_info", 0, 1, FEARG_1, f_timer_info},
|
{"timer_info", 0, 1, FEARG_1, f_timer_info},
|
||||||
@ -3433,9 +3431,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
"mksession",
|
"mksession",
|
||||||
#endif
|
#endif
|
||||||
"modify_fname",
|
"modify_fname",
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
"mouse",
|
"mouse",
|
||||||
#endif
|
|
||||||
#ifdef FEAT_MOUSESHAPE
|
#ifdef FEAT_MOUSESHAPE
|
||||||
"mouseshape",
|
"mouseshape",
|
||||||
#endif
|
#endif
|
||||||
|
@ -795,11 +795,9 @@ getcmdline_int(
|
|||||||
int save_msg_scroll = msg_scroll;
|
int save_msg_scroll = msg_scroll;
|
||||||
int save_State = State; /* remember State when called */
|
int save_State = State; /* remember State when called */
|
||||||
int some_key_typed = FALSE; /* one of the keys was typed */
|
int some_key_typed = FALSE; /* one of the keys was typed */
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/* mouse drag and release events are ignored, unless they are
|
/* mouse drag and release events are ignored, unless they are
|
||||||
* preceded with a mouse down event */
|
* preceded with a mouse down event */
|
||||||
int ignore_drag_release = TRUE;
|
int ignore_drag_release = TRUE;
|
||||||
#endif
|
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
int break_ctrl_c = FALSE;
|
int break_ctrl_c = FALSE;
|
||||||
#endif
|
#endif
|
||||||
@ -1856,7 +1854,6 @@ getcmdline_int(
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
case K_MIDDLEDRAG:
|
case K_MIDDLEDRAG:
|
||||||
case K_MIDDLERELEASE:
|
case K_MIDDLERELEASE:
|
||||||
goto cmdline_not_changed; /* Ignore mouse */
|
goto cmdline_not_changed; /* Ignore mouse */
|
||||||
@ -1961,8 +1958,6 @@ getcmdline_int(
|
|||||||
case K_MOUSEMOVE:
|
case K_MOUSEMOVE:
|
||||||
goto cmdline_not_changed;
|
goto cmdline_not_changed;
|
||||||
|
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
case K_LEFTMOUSE_NM: /* mousefocus click, ignored */
|
case K_LEFTMOUSE_NM: /* mousefocus click, ignored */
|
||||||
case K_LEFTRELEASE_NM:
|
case K_LEFTRELEASE_NM:
|
||||||
@ -2195,9 +2190,7 @@ getcmdline_int(
|
|||||||
|
|
||||||
case Ctrl_V:
|
case Ctrl_V:
|
||||||
case Ctrl_Q:
|
case Ctrl_Q:
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
ignore_drag_release = TRUE;
|
ignore_drag_release = TRUE;
|
||||||
#endif
|
|
||||||
putcmdline('^', TRUE);
|
putcmdline('^', TRUE);
|
||||||
c = get_literal(); /* get next (two) character(s) */
|
c = get_literal(); /* get next (two) character(s) */
|
||||||
do_abbr = FALSE; /* don't do abbreviation now */
|
do_abbr = FALSE; /* don't do abbreviation now */
|
||||||
@ -2213,13 +2206,11 @@ getcmdline_int(
|
|||||||
|
|
||||||
#ifdef FEAT_DIGRAPHS
|
#ifdef FEAT_DIGRAPHS
|
||||||
case Ctrl_K:
|
case Ctrl_K:
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
ignore_drag_release = TRUE;
|
ignore_drag_release = TRUE;
|
||||||
#endif
|
|
||||||
putcmdline('?', TRUE);
|
putcmdline('?', TRUE);
|
||||||
#ifdef USE_ON_FLY_SCROLL
|
# ifdef USE_ON_FLY_SCROLL
|
||||||
dont_scroll = TRUE; /* disallow scrolling here */
|
dont_scroll = TRUE; /* disallow scrolling here */
|
||||||
#endif
|
# endif
|
||||||
c = get_digraph(TRUE);
|
c = get_digraph(TRUE);
|
||||||
extra_char = NUL;
|
extra_char = NUL;
|
||||||
if (c != NUL)
|
if (c != NUL)
|
||||||
@ -2227,7 +2218,7 @@ getcmdline_int(
|
|||||||
|
|
||||||
redrawcmd();
|
redrawcmd();
|
||||||
goto cmdline_not_changed;
|
goto cmdline_not_changed;
|
||||||
#endif /* FEAT_DIGRAPHS */
|
#endif // FEAT_DIGRAPHS
|
||||||
|
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
case Ctrl__: /* CTRL-_: switch language mode */
|
case Ctrl__: /* CTRL-_: switch language mode */
|
||||||
|
@ -964,12 +964,12 @@
|
|||||||
* console mouse handling.
|
* console mouse handling.
|
||||||
* +mouse_urxvt Unix only: Include code for for urxvt mosue handling.
|
* +mouse_urxvt Unix only: Include code for for urxvt mosue handling.
|
||||||
* +mouse Any mouse support (any of the above enabled).
|
* +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 */
|
/* OS/2 and Amiga console have no mouse support */
|
||||||
#if !defined(AMIGA)
|
#if defined(UNIX) || defined(VMS)
|
||||||
# ifdef FEAT_NORMAL
|
# define FEAT_MOUSE_XTERM
|
||||||
# define FEAT_MOUSE_XTERM
|
|
||||||
# endif
|
|
||||||
# ifdef FEAT_BIG
|
# ifdef FEAT_BIG
|
||||||
# define FEAT_MOUSE_NET
|
# define FEAT_MOUSE_NET
|
||||||
# endif
|
# endif
|
||||||
@ -979,12 +979,12 @@
|
|||||||
# ifdef FEAT_BIG
|
# ifdef FEAT_BIG
|
||||||
# define FEAT_MOUSE_URXVT
|
# define FEAT_MOUSE_URXVT
|
||||||
# endif
|
# endif
|
||||||
# if defined(FEAT_NORMAL) && defined(MSWIN)
|
#endif
|
||||||
# define DOS_MOUSE
|
#if defined(MSWIN)
|
||||||
# endif
|
# define DOS_MOUSE
|
||||||
# if defined(FEAT_NORMAL) && defined(__QNX__)
|
#endif
|
||||||
# define FEAT_MOUSE_PTERM
|
#if defined(__QNX__)
|
||||||
# endif
|
# define FEAT_MOUSE_PTERM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1002,28 +1002,11 @@
|
|||||||
# define FEAT_SYSMOUSE
|
# define FEAT_SYSMOUSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* urxvt is a small variation of mouse_xterm, and shares its code */
|
// urxvt is a small variation of mouse_xterm, and shares its code
|
||||||
#if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM)
|
#if defined(FEAT_MOUSE_URXVT) && !defined(FEAT_MOUSE_XTERM)
|
||||||
# define FEAT_MOUSE_XTERM
|
# define FEAT_MOUSE_XTERM
|
||||||
#endif
|
#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.
|
* +clipboard Clipboard support. Always used for the GUI.
|
||||||
* +xterm_clipboard Unix only: Include code for handling the clipboard
|
* +xterm_clipboard Unix only: Include code for handling the clipboard
|
||||||
@ -1093,7 +1076,7 @@
|
|||||||
* to check if mouse dragging can be used and if term
|
* to check if mouse dragging can be used and if term
|
||||||
* codes can be obtained.
|
* codes can be obtained.
|
||||||
*/
|
*/
|
||||||
#if (defined(FEAT_NORMAL) || defined(FEAT_MOUSE)) && defined(HAVE_TGETENT)
|
#if defined(HAVE_TGETENT)
|
||||||
# define FEAT_TERMRESPONSE
|
# define FEAT_TERMRESPONSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1325,10 +1325,8 @@ save_typebuf(void)
|
|||||||
|
|
||||||
static int old_char = -1; /* character put back by vungetc() */
|
static int old_char = -1; /* character put back by vungetc() */
|
||||||
static int old_mod_mask; /* mod_mask for ungotten character */
|
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_row; /* mouse_row related to old_char */
|
||||||
static int old_mouse_col; /* mouse_col 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.
|
* Save all three kinds of typeahead, so that the user must type at a prompt.
|
||||||
@ -1559,10 +1557,8 @@ vgetc(void)
|
|||||||
c = old_char;
|
c = old_char;
|
||||||
old_char = -1;
|
old_char = -1;
|
||||||
mod_mask = old_mod_mask;
|
mod_mask = old_mod_mask;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
mouse_row = old_mouse_row;
|
mouse_row = old_mouse_row;
|
||||||
mouse_col = old_mouse_col;
|
mouse_col = old_mouse_col;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2007,7 +2003,6 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
|||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
rettv->vval.v_string = vim_strsave(temp);
|
rettv->vval.v_string = vim_strsave(temp);
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (is_mouse_key(n))
|
if (is_mouse_key(n))
|
||||||
{
|
{
|
||||||
int row = mouse_row;
|
int row = mouse_row;
|
||||||
@ -2025,11 +2020,11 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
|||||||
if (win == NULL)
|
if (win == NULL)
|
||||||
return;
|
return;
|
||||||
(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
|
(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
|
||||||
# ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_TEXT_PROP
|
||||||
if (WIN_IS_POPUP(win))
|
if (WIN_IS_POPUP(win))
|
||||||
winnr = 0;
|
winnr = 0;
|
||||||
else
|
else
|
||||||
# endif
|
#endif
|
||||||
for (wp = firstwin; wp != win && wp != NULL;
|
for (wp = firstwin; wp != win && wp != NULL;
|
||||||
wp = wp->w_next)
|
wp = wp->w_next)
|
||||||
++winnr;
|
++winnr;
|
||||||
@ -2039,7 +2034,6 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
|||||||
set_vim_var_nr(VV_MOUSE_COL, col + 1);
|
set_vim_var_nr(VV_MOUSE_COL, col + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2636,10 +2630,8 @@ vungetc(int c)
|
|||||||
{
|
{
|
||||||
old_char = c;
|
old_char = c;
|
||||||
old_mod_mask = mod_mask;
|
old_mod_mask = mod_mask;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
old_mouse_row = mouse_row;
|
old_mouse_row = mouse_row;
|
||||||
old_mouse_col = mouse_col;
|
old_mouse_col = mouse_col;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -470,7 +470,6 @@ EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0});
|
|||||||
EXTERN buf_T *au_pending_free_buf INIT(= NULL);
|
EXTERN buf_T *au_pending_free_buf INIT(= NULL);
|
||||||
EXTERN win_T *au_pending_free_win INIT(= NULL);
|
EXTERN win_T *au_pending_free_win INIT(= NULL);
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* Mouse coordinates, set by check_termcode()
|
* Mouse coordinates, set by check_termcode()
|
||||||
*/
|
*/
|
||||||
@ -480,15 +479,15 @@ EXTERN int mouse_past_bottom INIT(= FALSE);// mouse below last line
|
|||||||
EXTERN int mouse_past_eol INIT(= FALSE); // mouse right of line
|
EXTERN int mouse_past_eol INIT(= FALSE); // mouse right of line
|
||||||
EXTERN int mouse_dragging INIT(= 0); // extending Visual area with
|
EXTERN int mouse_dragging INIT(= 0); // extending Visual area with
|
||||||
// mouse dragging
|
// mouse dragging
|
||||||
# if defined(FEAT_MOUSE_DEC)
|
#if defined(FEAT_MOUSE_DEC)
|
||||||
/*
|
/*
|
||||||
* When the DEC mouse has been pressed but not yet released we enable
|
* When the DEC mouse has been pressed but not yet released we enable
|
||||||
* automatic queries for the mouse position.
|
* automatic queries for the mouse position.
|
||||||
*/
|
*/
|
||||||
EXTERN int WantQueryMouse INIT(= FALSE);
|
EXTERN int WantQueryMouse INIT(= FALSE);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
// When the window layout is about to be changed, need_mouse_correct is set,
|
// 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
|
// so that gui_mouse_correct() is called afterwards, to correct the mouse
|
||||||
// pointer when focus-follow-mouse is being used.
|
// pointer when focus-follow-mouse is being used.
|
||||||
@ -496,10 +495,10 @@ EXTERN int need_mouse_correct INIT(= FALSE);
|
|||||||
|
|
||||||
// When double clicking, topline must be the same
|
// When double clicking, topline must be the same
|
||||||
EXTERN linenr_T gui_prev_topline INIT(= 0);
|
EXTERN linenr_T gui_prev_topline INIT(= 0);
|
||||||
# ifdef FEAT_DIFF
|
# ifdef FEAT_DIFF
|
||||||
EXTERN int gui_prev_topfill INIT(= 0);
|
EXTERN int gui_prev_topfill INIT(= 0);
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
# ifdef FEAT_MOUSESHAPE
|
# ifdef FEAT_MOUSESHAPE
|
||||||
EXTERN int drag_status_line INIT(= FALSE); // dragging the status line
|
EXTERN int drag_status_line INIT(= FALSE); // dragging the status line
|
||||||
@ -508,7 +507,6 @@ EXTERN int postponed_mouseshape INIT(= FALSE); // postponed updating the
|
|||||||
EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator
|
EXTERN int drag_sep_line INIT(= FALSE); // dragging vert separator
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
// Value set from 'diffopt'.
|
// Value set from 'diffopt'.
|
||||||
@ -785,13 +783,11 @@ EXTERN int resel_VIsual_mode INIT(= NUL); // 'v', 'V', or Ctrl-V
|
|||||||
EXTERN linenr_T resel_VIsual_line_count; // number of lines
|
EXTERN linenr_T resel_VIsual_line_count; // number of lines
|
||||||
EXTERN colnr_T resel_VIsual_vcol; // nr of cols or end col
|
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
|
* When pasting text with the middle mouse button in visual mode with
|
||||||
* restart_edit set, remember where it started so we can set Insstart.
|
* restart_edit set, remember where it started so we can set Insstart.
|
||||||
*/
|
*/
|
||||||
EXTERN pos_T where_paste_started;
|
EXTERN pos_T where_paste_started;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This flag is used to make auto-indent work right on lines where only a
|
* This flag is used to make auto-indent work right on lines where only a
|
||||||
|
@ -1200,7 +1200,6 @@ wait_return(int redraw)
|
|||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
|| c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR
|
|| c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
|| c == K_LEFTDRAG || c == K_LEFTRELEASE
|
|| c == K_LEFTDRAG || c == K_LEFTRELEASE
|
||||||
|| c == K_MIDDLEDRAG || c == K_MIDDLERELEASE
|
|| c == K_MIDDLEDRAG || c == K_MIDDLERELEASE
|
||||||
|| c == K_RIGHTDRAG || c == K_RIGHTRELEASE
|
|| c == K_RIGHTDRAG || c == K_RIGHTRELEASE
|
||||||
@ -1214,19 +1213,15 @@ wait_return(int redraw)
|
|||||||
|| c == K_RIGHTMOUSE
|
|| c == K_RIGHTMOUSE
|
||||||
|| c == K_X1MOUSE
|
|| c == K_X1MOUSE
|
||||||
|| c == K_X2MOUSE))
|
|| c == K_X2MOUSE))
|
||||||
#endif
|
|
||||||
);
|
);
|
||||||
ui_breakcheck();
|
ui_breakcheck();
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* Avoid that the mouse-up event causes visual mode to start.
|
* Avoid that the mouse-up event causes visual mode to start.
|
||||||
*/
|
*/
|
||||||
if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE
|
if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE
|
||||||
|| c == K_X1MOUSE || c == K_X2MOUSE)
|
|| c == K_X1MOUSE || c == K_X2MOUSE)
|
||||||
(void)jump_to_mouse(MOUSE_SETPOS, NULL, 0);
|
(void)jump_to_mouse(MOUSE_SETPOS, NULL, 0);
|
||||||
else
|
else if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
|
||||||
#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
|
/* Put the character back in the typeahead buffer. Don't use the
|
||||||
* stuff buffer, because lmaps wouldn't work. */
|
* stuff buffer, because lmaps wouldn't work. */
|
||||||
|
@ -847,9 +847,7 @@ get_keystroke(void)
|
|||||||
n = TO_SPECIAL(buf[1], buf[2]);
|
n = TO_SPECIAL(buf[1], buf[2]);
|
||||||
if (buf[1] == KS_MODIFIER
|
if (buf[1] == KS_MODIFIER
|
||||||
|| n == K_IGNORE
|
|| n == K_IGNORE
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
|| (is_mouse_key(n) && n != K_LEFTMOUSE)
|
|| (is_mouse_key(n) && n != K_LEFTMOUSE)
|
||||||
#endif
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
|| n == K_VER_SCROLLBAR
|
|| n == K_VER_SCROLLBAR
|
||||||
|| n == K_HOR_SCROLLBAR
|
|| n == K_HOR_SCROLLBAR
|
||||||
@ -929,14 +927,12 @@ get_number(
|
|||||||
}
|
}
|
||||||
n /= 10;
|
n /= 10;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
else if (mouse_used != NULL && c == K_LEFTMOUSE)
|
else if (mouse_used != NULL && c == K_LEFTMOUSE)
|
||||||
{
|
{
|
||||||
*mouse_used = TRUE;
|
*mouse_used = TRUE;
|
||||||
n = mouse_row + 1;
|
n = mouse_row + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if (n == 0 && c == ':' && colon)
|
else if (n == 0 && c == ':' && colon)
|
||||||
{
|
{
|
||||||
stuffcharReadbuff(':');
|
stuffcharReadbuff(':');
|
||||||
|
54
src/mouse.c
54
src/mouse.c
@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get class of a character for selection: same class means same word.
|
* Get class of a character for selection: same class means same word.
|
||||||
* 0: blank
|
* 0: blank
|
||||||
@ -1258,20 +1256,17 @@ get_pseudo_mouse_code(
|
|||||||
return (int)KE_IGNORE; // not recognized, ignore it
|
return (int)KE_IGNORE; // not recognized, ignore it
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_TTY
|
# define HMT_NORMAL 1
|
||||||
# define HMT_NORMAL 1
|
# define HMT_NETTERM 2
|
||||||
# define HMT_NETTERM 2
|
# define HMT_DEC 4
|
||||||
# define HMT_DEC 4
|
# define HMT_JSBTERM 8
|
||||||
# define HMT_JSBTERM 8
|
# define HMT_PTERM 16
|
||||||
# define HMT_PTERM 16
|
# define HMT_URXVT 32
|
||||||
# define HMT_URXVT 32
|
# define HMT_GPM 64
|
||||||
# define HMT_GPM 64
|
# define HMT_SGR 128
|
||||||
# define HMT_SGR 128
|
# define HMT_SGR_REL 256
|
||||||
# define HMT_SGR_REL 256
|
|
||||||
static int has_mouse_termcode = 0;
|
static int has_mouse_termcode = 0;
|
||||||
# endif
|
|
||||||
|
|
||||||
# if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO)
|
|
||||||
void
|
void
|
||||||
set_mouse_termcode(
|
set_mouse_termcode(
|
||||||
int n, // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE
|
int n, // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE
|
||||||
@ -1282,7 +1277,6 @@ set_mouse_termcode(
|
|||||||
name[0] = n;
|
name[0] = n;
|
||||||
name[1] = KE_FILLER;
|
name[1] = KE_FILLER;
|
||||||
add_termcode(name, s, FALSE);
|
add_termcode(name, s, FALSE);
|
||||||
# ifdef FEAT_MOUSE_TTY
|
|
||||||
# ifdef FEAT_MOUSE_JSB
|
# ifdef FEAT_MOUSE_JSB
|
||||||
if (n == KS_JSBTERM_MOUSE)
|
if (n == KS_JSBTERM_MOUSE)
|
||||||
has_mouse_termcode |= HMT_JSBTERM;
|
has_mouse_termcode |= HMT_JSBTERM;
|
||||||
@ -1319,12 +1313,9 @@ set_mouse_termcode(
|
|||||||
has_mouse_termcode |= HMT_SGR_REL;
|
has_mouse_termcode |= HMT_SGR_REL;
|
||||||
else
|
else
|
||||||
has_mouse_termcode |= HMT_NORMAL;
|
has_mouse_termcode |= HMT_NORMAL;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
# if ((defined(UNIX) || defined(VMS)) \
|
# if defined(UNIX) || defined(VMS) || defined(PROTO)
|
||||||
&& defined(FEAT_MOUSE_TTY)) || defined(PROTO)
|
|
||||||
void
|
void
|
||||||
del_mouse_termcode(
|
del_mouse_termcode(
|
||||||
int n) // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE
|
int n) // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE
|
||||||
@ -1334,7 +1325,6 @@ del_mouse_termcode(
|
|||||||
name[0] = n;
|
name[0] = n;
|
||||||
name[1] = KE_FILLER;
|
name[1] = KE_FILLER;
|
||||||
del_termcode(name);
|
del_termcode(name);
|
||||||
# ifdef FEAT_MOUSE_TTY
|
|
||||||
# ifdef FEAT_MOUSE_JSB
|
# ifdef FEAT_MOUSE_JSB
|
||||||
if (n == KS_JSBTERM_MOUSE)
|
if (n == KS_JSBTERM_MOUSE)
|
||||||
has_mouse_termcode &= ~HMT_JSBTERM;
|
has_mouse_termcode &= ~HMT_JSBTERM;
|
||||||
@ -1371,7 +1361,6 @@ del_mouse_termcode(
|
|||||||
has_mouse_termcode &= ~HMT_SGR_REL;
|
has_mouse_termcode &= ~HMT_SGR_REL;
|
||||||
else
|
else
|
||||||
has_mouse_termcode &= ~HMT_NORMAL;
|
has_mouse_termcode &= ~HMT_NORMAL;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -1381,15 +1370,13 @@ del_mouse_termcode(
|
|||||||
void
|
void
|
||||||
setmouse(void)
|
setmouse(void)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_MOUSE_TTY
|
|
||||||
int checkfor;
|
int checkfor;
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef FEAT_MOUSESHAPE
|
# ifdef FEAT_MOUSESHAPE
|
||||||
update_mouseshape(-1);
|
update_mouseshape(-1);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_TTY // Should be outside proc, but may break MOUSESHAPE
|
// Should be outside proc, but may break MOUSESHAPE
|
||||||
# ifdef FEAT_GUI
|
# ifdef FEAT_GUI
|
||||||
// In the GUI the mouse is always enabled.
|
// In the GUI the mouse is always enabled.
|
||||||
if (gui.in_use)
|
if (gui.in_use)
|
||||||
@ -1423,7 +1410,6 @@ setmouse(void)
|
|||||||
mch_setmouse(TRUE);
|
mch_setmouse(TRUE);
|
||||||
else
|
else
|
||||||
mch_setmouse(FALSE);
|
mch_setmouse(FALSE);
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2289,7 +2275,7 @@ check_termcode_mouse(
|
|||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
|
# if defined(UNIX)
|
||||||
if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
|
if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
|
||||||
// mouse-move event, using MOUSE_DRAG works
|
// mouse-move event, using MOUSE_DRAG works
|
||||||
mouse_code = MOUSE_DRAG;
|
mouse_code = MOUSE_DRAG;
|
||||||
@ -2314,7 +2300,7 @@ check_termcode_mouse(
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
|
# if defined(UNIX)
|
||||||
else if (use_xterm_mouse() > 1)
|
else if (use_xterm_mouse() > 1)
|
||||||
{
|
{
|
||||||
if (mouse_code & MOUSE_DRAG_XTERM)
|
if (mouse_code & MOUSE_DRAG_XTERM)
|
||||||
@ -2810,10 +2796,8 @@ check_termcode_mouse(
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // FEAT_MOUSE
|
|
||||||
|
|
||||||
// Functions also used for popup windows.
|
// 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
|
* Compute the buffer line position from the screen position "rowp" / "colp" in
|
||||||
@ -3017,15 +3001,3 @@ vcol2col(win_T *wp, linenr_T lnum, int vcol)
|
|||||||
return (int)(ptr - line);
|
return (int)(ptr - line);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else // FEAT_MOUSE
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Dummy implementation of setmouse() to avoid lots of #ifdefs.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
setmouse(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // FEAT_MOUSE
|
|
||||||
|
28
src/move.c
28
src/move.c
@ -190,9 +190,7 @@ update_topline(void)
|
|||||||
int check_topline = FALSE;
|
int check_topline = FALSE;
|
||||||
int check_botline = FALSE;
|
int check_botline = FALSE;
|
||||||
long *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
|
long *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
int save_so = *so_ptr;
|
int save_so = *so_ptr;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If there is no valid screen and when the window height is zero just use
|
/* If there is no valid screen and when the window height is zero just use
|
||||||
* the cursor line. */
|
* the cursor line. */
|
||||||
@ -209,11 +207,9 @@ update_topline(void)
|
|||||||
if (curwin->w_valid & VALID_TOPLINE)
|
if (curwin->w_valid & VALID_TOPLINE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/* When dragging with the mouse, don't scroll that quickly */
|
/* When dragging with the mouse, don't scroll that quickly */
|
||||||
if (mouse_dragging > 0)
|
if (mouse_dragging > 0)
|
||||||
*so_ptr = mouse_dragging - 1;
|
*so_ptr = mouse_dragging - 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
old_topline = curwin->w_topline;
|
old_topline = curwin->w_topline;
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
@ -418,9 +414,7 @@ update_topline(void)
|
|||||||
validate_cursor();
|
validate_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
*so_ptr = save_so;
|
*so_ptr = save_so;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1751,10 +1745,8 @@ scroll_cursor_top(int min_scroll, int always)
|
|||||||
linenr_T new_topline;
|
linenr_T new_topline;
|
||||||
int off = get_scrolloff_value();
|
int off = get_scrolloff_value();
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (mouse_dragging > 0)
|
if (mouse_dragging > 0)
|
||||||
off = mouse_dragging - 1;
|
off = mouse_dragging - 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decrease topline until:
|
* Decrease topline until:
|
||||||
@ -2004,11 +1996,7 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
|
|||||||
/* Stop when scrolled nothing or at least "min_scroll", found "extra"
|
/* Stop when scrolled nothing or at least "min_scroll", found "extra"
|
||||||
* context for 'scrolloff' and counted all lines below the window. */
|
* context for 'scrolloff' and counted all lines below the window. */
|
||||||
if ((((scrolled <= 0 || scrolled >= min_scroll)
|
if ((((scrolled <= 0 || scrolled >= min_scroll)
|
||||||
&& extra >= (
|
&& extra >= (mouse_dragging > 0 ? mouse_dragging - 1 : so))
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
mouse_dragging > 0 ? mouse_dragging - 1 :
|
|
||||||
#endif
|
|
||||||
so))
|
|
||||||
|| boff.lnum + 1 > curbuf->b_ml.ml_line_count)
|
|| boff.lnum + 1 > curbuf->b_ml.ml_line_count)
|
||||||
&& loff.lnum <= curwin->w_botline
|
&& loff.lnum <= curwin->w_botline
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
@ -2050,11 +2038,8 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
|
|||||||
used += boff.height;
|
used += boff.height;
|
||||||
if (used > curwin->w_height)
|
if (used > curwin->w_height)
|
||||||
break;
|
break;
|
||||||
if (extra < (
|
if (extra < ( mouse_dragging > 0 ? mouse_dragging - 1 : so)
|
||||||
#ifdef FEAT_MOUSE
|
|| scrolled < min_scroll)
|
||||||
mouse_dragging > 0 ? mouse_dragging - 1 :
|
|
||||||
#endif
|
|
||||||
so) || scrolled < min_scroll)
|
|
||||||
{
|
{
|
||||||
extra += boff.height;
|
extra += boff.height;
|
||||||
if (boff.lnum >= curwin->w_botline
|
if (boff.lnum >= curwin->w_botline
|
||||||
@ -2230,13 +2215,11 @@ cursor_correct(void)
|
|||||||
*/
|
*/
|
||||||
above_wanted = so;
|
above_wanted = so;
|
||||||
below_wanted = so;
|
below_wanted = so;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (mouse_dragging > 0)
|
if (mouse_dragging > 0)
|
||||||
{
|
{
|
||||||
above_wanted = mouse_dragging - 1;
|
above_wanted = mouse_dragging - 1;
|
||||||
below_wanted = mouse_dragging - 1;
|
below_wanted = mouse_dragging - 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (curwin->w_topline == 1)
|
if (curwin->w_topline == 1)
|
||||||
{
|
{
|
||||||
above_wanted = 0;
|
above_wanted = 0;
|
||||||
@ -2246,10 +2229,7 @@ cursor_correct(void)
|
|||||||
}
|
}
|
||||||
validate_botline();
|
validate_botline();
|
||||||
if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1
|
if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1
|
||||||
#ifdef FEAT_MOUSE
|
&& mouse_dragging == 0)
|
||||||
&& mouse_dragging == 0
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
below_wanted = 0;
|
below_wanted = 0;
|
||||||
max_off = (curwin->w_height - 1) / 2;
|
max_off = (curwin->w_height - 1) / 2;
|
||||||
|
16
src/normal.c
16
src/normal.c
@ -303,7 +303,6 @@ static const struct nv_cmd
|
|||||||
|
|
||||||
/* pound sign */
|
/* pound sign */
|
||||||
{POUND, nv_ident, 0, 0},
|
{POUND, nv_ident, 0, 0},
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
{K_MOUSEUP, nv_mousescroll, 0, MSCR_UP},
|
{K_MOUSEUP, nv_mousescroll, 0, MSCR_UP},
|
||||||
{K_MOUSEDOWN, nv_mousescroll, 0, MSCR_DOWN},
|
{K_MOUSEDOWN, nv_mousescroll, 0, MSCR_DOWN},
|
||||||
{K_MOUSELEFT, nv_mousescroll, 0, MSCR_LEFT},
|
{K_MOUSELEFT, nv_mousescroll, 0, MSCR_LEFT},
|
||||||
@ -326,7 +325,6 @@ static const struct nv_cmd
|
|||||||
{K_X2MOUSE, nv_mouse, 0, 0},
|
{K_X2MOUSE, nv_mouse, 0, 0},
|
||||||
{K_X2DRAG, nv_mouse, 0, 0},
|
{K_X2DRAG, nv_mouse, 0, 0},
|
||||||
{K_X2RELEASE, nv_mouse, 0, 0},
|
{K_X2RELEASE, nv_mouse, 0, 0},
|
||||||
#endif
|
|
||||||
{K_IGNORE, nv_ignore, NV_KEEPREG, 0},
|
{K_IGNORE, nv_ignore, NV_KEEPREG, 0},
|
||||||
{K_NOP, nv_nop, 0, 0},
|
{K_NOP, nv_nop, 0, 0},
|
||||||
{K_INS, nv_edit, 0, 0},
|
{K_INS, nv_edit, 0, 0},
|
||||||
@ -1319,10 +1317,8 @@ end_visual_mode(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
VIsual_active = FALSE;
|
VIsual_active = FALSE;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
setmouse();
|
setmouse();
|
||||||
mouse_dragging = 0;
|
mouse_dragging = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Save the current VIsual area for '< and '> marks, and "gv" */
|
/* Save the current VIsual area for '< and '> marks, and "gv" */
|
||||||
curbuf->b_visual.vi_mode = VIsual_mode;
|
curbuf->b_visual.vi_mode = VIsual_mode;
|
||||||
@ -1849,14 +1845,13 @@ add_to_showcmd(int c)
|
|||||||
int old_len;
|
int old_len;
|
||||||
int extra_len;
|
int extra_len;
|
||||||
int overflow;
|
int overflow;
|
||||||
#if defined(FEAT_MOUSE)
|
|
||||||
int i;
|
int i;
|
||||||
static int ignore[] =
|
static int ignore[] =
|
||||||
{
|
{
|
||||||
# ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
|
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
|
||||||
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
|
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
|
||||||
# endif
|
#endif
|
||||||
K_IGNORE, K_PS,
|
K_IGNORE, K_PS,
|
||||||
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE,
|
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE,
|
||||||
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
|
||||||
@ -1866,7 +1861,6 @@ add_to_showcmd(int c)
|
|||||||
K_CURSORHOLD,
|
K_CURSORHOLD,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!p_sc || msg_silent != 0)
|
if (!p_sc || msg_silent != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1877,13 +1871,11 @@ add_to_showcmd(int c)
|
|||||||
showcmd_visual = FALSE;
|
showcmd_visual = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE)
|
|
||||||
/* Ignore keys that are scrollbar updates and mouse clicks */
|
/* Ignore keys that are scrollbar updates and mouse clicks */
|
||||||
if (IS_SPECIAL(c))
|
if (IS_SPECIAL(c))
|
||||||
for (i = 0; ignore[i] != 0; ++i)
|
for (i = 0; ignore[i] != 0; ++i)
|
||||||
if (ignore[i] == c)
|
if (ignore[i] == c)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
p = transchar(c);
|
p = transchar(c);
|
||||||
if (*p == ' ')
|
if (*p == ' ')
|
||||||
@ -4625,7 +4617,6 @@ nv_brackets(cmdarg_T *cap)
|
|||||||
nv_cursormark(cap, cap->nchar == '\'', pos);
|
nv_cursormark(cap, cap->nchar == '\'', pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* [ or ] followed by a middle mouse click: put selected text with
|
* [ or ] followed by a middle mouse click: put selected text with
|
||||||
* indent adjustment. Any other button just does as usual.
|
* indent adjustment. Any other button just does as usual.
|
||||||
@ -4636,7 +4627,6 @@ nv_brackets(cmdarg_T *cap)
|
|||||||
(cap->cmdchar == ']') ? FORWARD : BACKWARD,
|
(cap->cmdchar == ']') ? FORWARD : BACKWARD,
|
||||||
cap->count1, PUT_FIXINDENT);
|
cap->count1, PUT_FIXINDENT);
|
||||||
}
|
}
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
#ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
/*
|
/*
|
||||||
@ -6220,7 +6210,6 @@ nv_g_cmd(cmdarg_T *cap)
|
|||||||
nv_gd(oap, cap->nchar, (int)cap->count0);
|
nv_gd(oap, cap->nchar, (int)cap->count0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
/*
|
/*
|
||||||
* g<*Mouse> : <C-*mouse>
|
* g<*Mouse> : <C-*mouse>
|
||||||
*/
|
*/
|
||||||
@ -6243,7 +6232,6 @@ nv_g_cmd(cmdarg_T *cap)
|
|||||||
mod_mask = MOD_MASK_CTRL;
|
mod_mask = MOD_MASK_CTRL;
|
||||||
(void)do_mouse(oap, cap->nchar, BACKWARD, cap->count1, 0);
|
(void)do_mouse(oap, cap->nchar, BACKWARD, cap->count1, 0);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case K_IGNORE:
|
case K_IGNORE:
|
||||||
break;
|
break;
|
||||||
|
@ -4369,10 +4369,8 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
|
|||||||
if (!gui_yank)
|
if (!gui_yank)
|
||||||
{
|
{
|
||||||
VIsual_active = FALSE;
|
VIsual_active = FALSE;
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
setmouse();
|
setmouse();
|
||||||
mouse_dragging = 0;
|
mouse_dragging = 0;
|
||||||
#endif
|
|
||||||
may_clear_cmdline();
|
may_clear_cmdline();
|
||||||
if ((oap->op_type == OP_YANK
|
if ((oap->op_type == OP_YANK
|
||||||
|| oap->op_type == OP_COLON
|
|| oap->op_type == OP_COLON
|
||||||
|
@ -4976,9 +4976,7 @@ clear_termoptions(void)
|
|||||||
* outputting a few things that the terminal doesn't understand, but the
|
* outputting a few things that the terminal doesn't understand, but the
|
||||||
* screen will be cleared later, so this is OK.
|
* screen will be cleared later, so this is OK.
|
||||||
*/
|
*/
|
||||||
#ifdef FEAT_MOUSE_TTY
|
mch_setmouse(FALSE); // switch mouse off
|
||||||
mch_setmouse(FALSE); /* switch mouse off */
|
|
||||||
#endif
|
|
||||||
#ifdef FEAT_TITLE
|
#ifdef FEAT_TITLE
|
||||||
mch_restore_title(SAVE_RESTORE_BOTH); /* restore window titles */
|
mch_restore_title(SAVE_RESTORE_BOTH); /* restore window titles */
|
||||||
#endif
|
#endif
|
||||||
|
@ -979,7 +979,7 @@ EXTERN unsigned tbis_flags;
|
|||||||
# define TBIS_GIANT 0x20
|
# define TBIS_GIANT 0x20
|
||||||
#endif
|
#endif
|
||||||
EXTERN long p_ttyscroll; // 'ttyscroll'
|
EXTERN long p_ttyscroll; // 'ttyscroll'
|
||||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
#if defined(UNIX) || defined(VMS)
|
||||||
EXTERN char_u *p_ttym; // 'ttymouse'
|
EXTERN char_u *p_ttym; // 'ttymouse'
|
||||||
EXTERN unsigned ttym_flags;
|
EXTERN unsigned ttym_flags;
|
||||||
# define TTYM_XTERM 0x01
|
# define TTYM_XTERM 0x01
|
||||||
|
@ -2655,7 +2655,7 @@ static struct vimoption options[] =
|
|||||||
(char_u *)&p_tf, PV_NONE,
|
(char_u *)&p_tf, PV_NONE,
|
||||||
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
||||||
{"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF,
|
{"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF,
|
||||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
#if defined(UNIX) || defined(VMS)
|
||||||
(char_u *)&p_ttym, PV_NONE,
|
(char_u *)&p_ttym, PV_NONE,
|
||||||
#else
|
#else
|
||||||
(char_u *)NULL, PV_NONE,
|
(char_u *)NULL, PV_NONE,
|
||||||
|
@ -47,7 +47,7 @@ static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL}
|
|||||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||||
static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL};
|
static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL};
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
#if defined(UNIX) || defined(VMS)
|
||||||
static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL};
|
static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL};
|
||||||
#endif
|
#endif
|
||||||
static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL};
|
static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL};
|
||||||
@ -110,7 +110,7 @@ didset_string_options(void)
|
|||||||
(void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE);
|
(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_tc, p_tc_values, &tc_flags, FALSE);
|
||||||
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
|
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
|
||||||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
#if defined(UNIX) || defined(VMS)
|
||||||
(void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE);
|
(void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE);
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
||||||
@ -1588,7 +1588,7 @@ did_set_string_option(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
|
#if defined(UNIX) || defined(VMS)
|
||||||
// 'ttymouse'
|
// 'ttymouse'
|
||||||
else if (varp == &p_ttym)
|
else if (varp == &p_ttym)
|
||||||
{
|
{
|
||||||
@ -2254,12 +2254,7 @@ did_set_string_option(
|
|||||||
#endif
|
#endif
|
||||||
else if (varp == &p_mouse) // 'mouse'
|
else if (varp == &p_mouse) // 'mouse'
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
p = (char_u *)MOUSE_ALL;
|
p = (char_u *)MOUSE_ALL;
|
||||||
#else
|
|
||||||
if (*p_mouse != NUL)
|
|
||||||
errmsg = N_("E538: No mouse support");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if defined(FEAT_GUI)
|
#if defined(FEAT_GUI)
|
||||||
else if (varp == &p_go) // 'guioptions'
|
else if (varp == &p_go) // 'guioptions'
|
||||||
@ -2389,20 +2384,16 @@ did_set_string_option(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (varp == &p_mouse)
|
if (varp == &p_mouse)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_MOUSE_TTY
|
|
||||||
if (*p_mouse == NUL)
|
if (*p_mouse == NUL)
|
||||||
mch_setmouse(FALSE); // switch mouse off
|
mch_setmouse(FALSE); // switch mouse off
|
||||||
else
|
else
|
||||||
# endif
|
|
||||||
setmouse(); // in case 'mouse' changed
|
setmouse(); // in case 'mouse' changed
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (curwin->w_curswant != MAXCOL
|
if (curwin->w_curswant != MAXCOL
|
||||||
&& (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0)
|
&& (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0)
|
||||||
curwin->w_set_curswant = TRUE;
|
curwin->w_set_curswant = TRUE;
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
|
@ -2282,7 +2282,6 @@ use_xterm_like_mouse(char_u *name)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Return non-zero when using an xterm mouse, according to 'ttymouse'.
|
* Return non-zero when using an xterm mouse, according to 'ttymouse'.
|
||||||
* Return 1 for "xterm".
|
* Return 1 for "xterm".
|
||||||
@ -2303,7 +2302,6 @@ use_xterm_mouse(void)
|
|||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
int
|
||||||
vim_is_iris(char_u *name)
|
vim_is_iris(char_u *name)
|
||||||
@ -3592,7 +3590,6 @@ get_tty_info(int fd, ttyinfo_T *info)
|
|||||||
|
|
||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
|
|
||||||
static int mouse_ison = FALSE;
|
static int mouse_ison = FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3601,29 +3598,29 @@ static int mouse_ison = FALSE;
|
|||||||
void
|
void
|
||||||
mch_setmouse(int on)
|
mch_setmouse(int on)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_BEVAL_TERM
|
#ifdef FEAT_BEVAL_TERM
|
||||||
static int bevalterm_ison = FALSE;
|
static int bevalterm_ison = FALSE;
|
||||||
# endif
|
#endif
|
||||||
int xterm_mouse_vers;
|
int xterm_mouse_vers;
|
||||||
|
|
||||||
# if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
|
#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
|
||||||
if (!on)
|
if (!on)
|
||||||
// Make sure not tracing mouse movements. Important when a button-down
|
// Make sure not tracing mouse movements. Important when a button-down
|
||||||
// was received but no release yet.
|
// was received but no release yet.
|
||||||
stop_xterm_trace();
|
stop_xterm_trace();
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (on == mouse_ison
|
if (on == mouse_ison
|
||||||
# ifdef FEAT_BEVAL_TERM
|
#ifdef FEAT_BEVAL_TERM
|
||||||
&& p_bevalterm == bevalterm_ison
|
&& p_bevalterm == bevalterm_ison
|
||||||
# endif
|
#endif
|
||||||
)
|
)
|
||||||
/* return quickly if nothing to do */
|
/* return quickly if nothing to do */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
xterm_mouse_vers = use_xterm_mouse();
|
xterm_mouse_vers = use_xterm_mouse();
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_URXVT
|
#ifdef FEAT_MOUSE_URXVT
|
||||||
if (ttym_flags == TTYM_URXVT)
|
if (ttym_flags == TTYM_URXVT)
|
||||||
{
|
{
|
||||||
out_str_nf((char_u *)
|
out_str_nf((char_u *)
|
||||||
@ -3632,7 +3629,7 @@ mch_setmouse(int on)
|
|||||||
: IF_EB("\033[?1015l", ESC_STR "[?1015l")));
|
: IF_EB("\033[?1015l", ESC_STR "[?1015l")));
|
||||||
mouse_ison = on;
|
mouse_ison = on;
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (ttym_flags == TTYM_SGR)
|
if (ttym_flags == TTYM_SGR)
|
||||||
{
|
{
|
||||||
@ -3644,7 +3641,7 @@ mch_setmouse(int on)
|
|||||||
mouse_ison = on;
|
mouse_ison = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FEAT_BEVAL_TERM
|
#ifdef FEAT_BEVAL_TERM
|
||||||
if (bevalterm_ison != (p_bevalterm && on))
|
if (bevalterm_ison != (p_bevalterm && on))
|
||||||
{
|
{
|
||||||
bevalterm_ison = (p_bevalterm && on);
|
bevalterm_ison = (p_bevalterm && on);
|
||||||
@ -3653,7 +3650,7 @@ mch_setmouse(int on)
|
|||||||
out_str_nf((char_u *)
|
out_str_nf((char_u *)
|
||||||
(IF_EB("\033[?1003l", ESC_STR "[?1003l")));
|
(IF_EB("\033[?1003l", ESC_STR "[?1003l")));
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
if (xterm_mouse_vers > 0)
|
if (xterm_mouse_vers > 0)
|
||||||
{
|
{
|
||||||
@ -3661,10 +3658,10 @@ mch_setmouse(int on)
|
|||||||
out_str_nf((char_u *)
|
out_str_nf((char_u *)
|
||||||
(xterm_mouse_vers > 1
|
(xterm_mouse_vers > 1
|
||||||
? (
|
? (
|
||||||
# ifdef FEAT_BEVAL_TERM
|
#ifdef FEAT_BEVAL_TERM
|
||||||
bevalterm_ison
|
bevalterm_ison
|
||||||
? IF_EB("\033[?1003h", ESC_STR "[?1003h") :
|
? IF_EB("\033[?1003h", ESC_STR "[?1003h") :
|
||||||
# endif
|
#endif
|
||||||
IF_EB("\033[?1002h", ESC_STR "[?1002h"))
|
IF_EB("\033[?1002h", ESC_STR "[?1002h"))
|
||||||
: IF_EB("\033[?1000h", ESC_STR "[?1000h")));
|
: IF_EB("\033[?1000h", ESC_STR "[?1000h")));
|
||||||
else /* disable mouse events, could probably always send the same */
|
else /* disable mouse events, could probably always send the same */
|
||||||
@ -3675,7 +3672,7 @@ mch_setmouse(int on)
|
|||||||
mouse_ison = on;
|
mouse_ison = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_DEC
|
#ifdef FEAT_MOUSE_DEC
|
||||||
else if (ttym_flags == TTYM_DEC)
|
else if (ttym_flags == TTYM_DEC)
|
||||||
{
|
{
|
||||||
if (on) /* enable mouse events */
|
if (on) /* enable mouse events */
|
||||||
@ -3684,9 +3681,9 @@ mch_setmouse(int on)
|
|||||||
out_str_nf((char_u *)"\033['z");
|
out_str_nf((char_u *)"\033['z");
|
||||||
mouse_ison = on;
|
mouse_ison = on;
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_GPM
|
#ifdef FEAT_MOUSE_GPM
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (on)
|
if (on)
|
||||||
@ -3700,9 +3697,9 @@ mch_setmouse(int on)
|
|||||||
mouse_ison = FALSE;
|
mouse_ison = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef FEAT_SYSMOUSE
|
#ifdef FEAT_SYSMOUSE
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (on)
|
if (on)
|
||||||
@ -3716,9 +3713,9 @@ mch_setmouse(int on)
|
|||||||
mouse_ison = FALSE;
|
mouse_ison = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_JSB
|
#ifdef FEAT_MOUSE_JSB
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (on)
|
if (on)
|
||||||
@ -3738,14 +3735,14 @@ mch_setmouse(int on)
|
|||||||
* 4 = Windows Cross Hair
|
* 4 = Windows Cross Hair
|
||||||
* 5 = Windows UP Arrow
|
* 5 = Windows UP Arrow
|
||||||
*/
|
*/
|
||||||
# ifdef JSBTERM_MOUSE_NONADVANCED
|
# ifdef JSBTERM_MOUSE_NONADVANCED
|
||||||
/* Disables full feedback of pointer movements */
|
/* Disables full feedback of pointer movements */
|
||||||
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\",
|
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\",
|
||||||
ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\"));
|
ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\"));
|
||||||
# else
|
# else
|
||||||
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\",
|
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\",
|
||||||
ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\"));
|
ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\"));
|
||||||
# endif
|
# endif
|
||||||
mouse_ison = TRUE;
|
mouse_ison = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3755,8 +3752,8 @@ mch_setmouse(int on)
|
|||||||
mouse_ison = FALSE;
|
mouse_ison = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_PTERM
|
#ifdef FEAT_MOUSE_PTERM
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */
|
/* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */
|
||||||
@ -3766,7 +3763,7 @@ mch_setmouse(int on)
|
|||||||
out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h");
|
out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h");
|
||||||
mouse_ison = on;
|
mouse_ison = on;
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_BEVAL_TERM) || defined(PROTO)
|
#if defined(FEAT_BEVAL_TERM) || defined(PROTO)
|
||||||
@ -3929,7 +3926,6 @@ check_mouse_termcode(void)
|
|||||||
del_mouse_termcode(KS_SGR_MOUSE_RELEASE);
|
del_mouse_termcode(KS_SGR_MOUSE_RELEASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set screen mode, always fails.
|
* set screen mode, always fails.
|
||||||
|
@ -1127,17 +1127,15 @@ decode_key_event(
|
|||||||
#endif /* FEAT_GUI_MSWIN */
|
#endif /* FEAT_GUI_MSWIN */
|
||||||
|
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For the GUI the mouse handling is in gui_w32.c.
|
* For the GUI the mouse handling is in gui_w32.c.
|
||||||
*/
|
*/
|
||||||
# if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL)
|
#if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL)
|
||||||
void
|
void
|
||||||
mch_setmouse(int on UNUSED)
|
mch_setmouse(int on UNUSED)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
# else
|
#else
|
||||||
static int g_fMouseAvail = FALSE; /* mouse present */
|
static int g_fMouseAvail = FALSE; /* mouse present */
|
||||||
static int g_fMouseActive = FALSE; /* mouse enabled */
|
static int g_fMouseActive = FALSE; /* mouse enabled */
|
||||||
static int g_nMouseClick = -1; /* mouse status */
|
static int g_nMouseClick = -1; /* mouse status */
|
||||||
@ -1152,10 +1150,10 @@ mch_setmouse(int on)
|
|||||||
{
|
{
|
||||||
DWORD cmodein;
|
DWORD cmodein;
|
||||||
|
|
||||||
# ifdef VIMDLL
|
# ifdef VIMDLL
|
||||||
if (gui.in_use)
|
if (gui.in_use)
|
||||||
return;
|
return;
|
||||||
# endif
|
# endif
|
||||||
if (!g_fMouseAvail)
|
if (!g_fMouseAvail)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1171,7 +1169,7 @@ mch_setmouse(int on)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(FEAT_BEVAL_TERM) || defined(PROTO)
|
# if defined(FEAT_BEVAL_TERM) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* Called when 'balloonevalterm' changed.
|
* Called when 'balloonevalterm' changed.
|
||||||
*/
|
*/
|
||||||
@ -1180,7 +1178,7 @@ mch_bevalterm_changed(void)
|
|||||||
{
|
{
|
||||||
mch_setmouse(g_fMouseActive);
|
mch_setmouse(g_fMouseActive);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT,
|
* Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT,
|
||||||
@ -1218,9 +1216,9 @@ decode_mouse_event(
|
|||||||
static int s_xOldMouse = -1;
|
static int s_xOldMouse = -1;
|
||||||
static int s_yOldMouse = -1;
|
static int s_yOldMouse = -1;
|
||||||
static linenr_T s_old_topline = 0;
|
static linenr_T s_old_topline = 0;
|
||||||
#ifdef FEAT_DIFF
|
# ifdef FEAT_DIFF
|
||||||
static int s_old_topfill = 0;
|
static int s_old_topfill = 0;
|
||||||
#endif
|
# endif
|
||||||
static int s_cClicks = 1;
|
static int s_cClicks = 1;
|
||||||
static BOOL s_fReleased = TRUE;
|
static BOOL s_fReleased = TRUE;
|
||||||
static DWORD s_dwLastClickTime = 0;
|
static DWORD s_dwLastClickTime = 0;
|
||||||
@ -1275,12 +1273,12 @@ decode_mouse_event(
|
|||||||
/* If the last thing returned was MOUSE_RELEASE, ignore this */
|
/* If the last thing returned was MOUSE_RELEASE, ignore this */
|
||||||
if (s_fReleased)
|
if (s_fReleased)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_BEVAL_TERM
|
# ifdef FEAT_BEVAL_TERM
|
||||||
/* do return mouse move events when we want them */
|
/* do return mouse move events when we want them */
|
||||||
if (p_bevalterm)
|
if (p_bevalterm)
|
||||||
nButton = MOUSE_DRAG;
|
nButton = MOUSE_DRAG;
|
||||||
else
|
else
|
||||||
#endif
|
# endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1386,9 +1384,9 @@ decode_mouse_event(
|
|||||||
|| s_yOldMouse != g_yMouse
|
|| s_yOldMouse != g_yMouse
|
||||||
|| s_nOldButton != nButton
|
|| s_nOldButton != nButton
|
||||||
|| s_old_topline != curwin->w_topline
|
|| s_old_topline != curwin->w_topline
|
||||||
#ifdef FEAT_DIFF
|
# ifdef FEAT_DIFF
|
||||||
|| s_old_topfill != curwin->w_topfill
|
|| s_old_topfill != curwin->w_topfill
|
||||||
#endif
|
# endif
|
||||||
|| (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset)
|
|| (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset)
|
||||||
{
|
{
|
||||||
s_cClicks = 1;
|
s_cClicks = 1;
|
||||||
@ -1439,16 +1437,15 @@ decode_mouse_event(
|
|||||||
s_xOldMouse = g_xMouse;
|
s_xOldMouse = g_xMouse;
|
||||||
s_yOldMouse = g_yMouse;
|
s_yOldMouse = g_yMouse;
|
||||||
s_old_topline = curwin->w_topline;
|
s_old_topline = curwin->w_topline;
|
||||||
#ifdef FEAT_DIFF
|
# ifdef FEAT_DIFF
|
||||||
s_old_topfill = curwin->w_topfill;
|
s_old_topfill = curwin->w_topfill;
|
||||||
#endif
|
# endif
|
||||||
s_nOldMouseClick = g_nMouseClick;
|
s_nOldMouseClick = g_nMouseClick;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* FEAT_GUI_MSWIN */
|
#endif // FEAT_GUI_MSWIN
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MCH_CURSOR_SHAPE
|
#ifdef MCH_CURSOR_SHAPE
|
||||||
@ -1547,10 +1544,7 @@ WaitForChar(long msec, int ignore_input)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0
|
if (g_nMouseClick != -1
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
|| g_nMouseClick != -1
|
|
||||||
#endif
|
|
||||||
#ifdef FEAT_CLIENTSERVER
|
#ifdef FEAT_CLIENTSERVER
|
||||||
|| (!ignore_input && input_available())
|
|| (!ignore_input && input_available())
|
||||||
#endif
|
#endif
|
||||||
@ -1683,11 +1677,9 @@ WaitForChar(long msec, int ignore_input)
|
|||||||
shell_resized();
|
shell_resized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
else if (ir.EventType == MOUSE_EVENT
|
else if (ir.EventType == MOUSE_EVENT
|
||||||
&& decode_mouse_event(&ir.Event.MouseEvent))
|
&& decode_mouse_event(&ir.Event.MouseEvent))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (msec == 0)
|
else if (msec == 0)
|
||||||
break;
|
break;
|
||||||
@ -1760,10 +1752,8 @@ tgetch(int *pmodifiers, WCHAR *pch2)
|
|||||||
(void)WaitForChar(-1L, FALSE);
|
(void)WaitForChar(-1L, FALSE);
|
||||||
if (input_available())
|
if (input_available())
|
||||||
return 0;
|
return 0;
|
||||||
# ifdef FEAT_MOUSE
|
|
||||||
if (g_nMouseClick != -1)
|
if (g_nMouseClick != -1)
|
||||||
return 0;
|
return 0;
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
if (read_console_input(g_hConIn, &ir, 1, &cRecords) == 0)
|
if (read_console_input(g_hConIn, &ir, 1, &cRecords) == 0)
|
||||||
{
|
{
|
||||||
@ -1783,13 +1773,11 @@ tgetch(int *pmodifiers, WCHAR *pch2)
|
|||||||
handle_focus_event(ir);
|
handle_focus_event(ir);
|
||||||
else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT)
|
else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT)
|
||||||
shell_resized();
|
shell_resized();
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
else if (ir.EventType == MOUSE_EVENT)
|
else if (ir.EventType == MOUSE_EVENT)
|
||||||
{
|
{
|
||||||
if (decode_mouse_event(&ir.Event.MouseEvent))
|
if (decode_mouse_event(&ir.Event.MouseEvent))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !FEAT_GUI_MSWIN */
|
#endif /* !FEAT_GUI_MSWIN */
|
||||||
@ -1879,14 +1867,13 @@ mch_inchar(
|
|||||||
typeaheadlen = 0;
|
typeaheadlen = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (g_nMouseClick != -1)
|
if (g_nMouseClick != -1)
|
||||||
{
|
{
|
||||||
# ifdef MCH_WRITE_DUMP
|
#ifdef MCH_WRITE_DUMP
|
||||||
if (fdDump)
|
if (fdDump)
|
||||||
fprintf(fdDump, "{%02x @ %d, %d}",
|
fprintf(fdDump, "{%02x @ %d, %d}",
|
||||||
g_nMouseClick, g_xMouse, g_yMouse);
|
g_nMouseClick, g_xMouse, g_yMouse);
|
||||||
# endif
|
#endif
|
||||||
typeahead[typeaheadlen++] = ESC + 128;
|
typeahead[typeaheadlen++] = ESC + 128;
|
||||||
typeahead[typeaheadlen++] = 'M';
|
typeahead[typeaheadlen++] = 'M';
|
||||||
typeahead[typeaheadlen++] = g_nMouseClick;
|
typeahead[typeaheadlen++] = g_nMouseClick;
|
||||||
@ -1895,7 +1882,6 @@ mch_inchar(
|
|||||||
g_nMouseClick = -1;
|
g_nMouseClick = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
WCHAR ch2 = NUL;
|
WCHAR ch2 = NUL;
|
||||||
int modifiers = 0;
|
int modifiers = 0;
|
||||||
@ -1918,9 +1904,7 @@ mch_inchar(
|
|||||||
got_int = TRUE;
|
got_int = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (g_nMouseClick == -1)
|
if (g_nMouseClick == -1)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int n = 1;
|
int n = 1;
|
||||||
|
|
||||||
@ -2675,9 +2659,7 @@ mch_init_c(void)
|
|||||||
|
|
||||||
g_fWindInitCalled = TRUE;
|
g_fWindInitCalled = TRUE;
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT);
|
g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_CLIPBOARD
|
#ifdef FEAT_CLIPBOARD
|
||||||
win_clip_init();
|
win_clip_init();
|
||||||
@ -3609,10 +3591,8 @@ mch_settmode(int tmode)
|
|||||||
{
|
{
|
||||||
cmodein &= ~(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT |
|
cmodein &= ~(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT |
|
||||||
ENABLE_ECHO_INPUT);
|
ENABLE_ECHO_INPUT);
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (g_fMouseActive)
|
if (g_fMouseActive)
|
||||||
cmodein |= ENABLE_MOUSE_INPUT;
|
cmodein |= ENABLE_MOUSE_INPUT;
|
||||||
#endif
|
|
||||||
cmodeout &= ~(
|
cmodeout &= ~(
|
||||||
#ifdef FEAT_TERMGUICOLORS
|
#ifdef FEAT_TERMGUICOLORS
|
||||||
/* Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using
|
/* Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using
|
||||||
@ -5501,12 +5481,10 @@ termcap_mode_start(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
GetConsoleMode(g_hConIn, &cmodein);
|
GetConsoleMode(g_hConIn, &cmodein);
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
if (g_fMouseActive)
|
if (g_fMouseActive)
|
||||||
cmodein |= ENABLE_MOUSE_INPUT;
|
cmodein |= ENABLE_MOUSE_INPUT;
|
||||||
else
|
else
|
||||||
cmodein &= ~ENABLE_MOUSE_INPUT;
|
cmodein &= ~ENABLE_MOUSE_INPUT;
|
||||||
#endif
|
|
||||||
cmodein |= ENABLE_WINDOW_INPUT;
|
cmodein |= ENABLE_WINDOW_INPUT;
|
||||||
SetConsoleMode(g_hConIn, cmodein);
|
SetConsoleMode(g_hConIn, cmodein);
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define USE_FNAME_CASE /* adjust case of file names */
|
#define USE_FNAME_CASE /* adjust case of file names */
|
||||||
#if !defined(FEAT_CLIPBOARD) && defined(FEAT_MOUSE)
|
#if !defined(FEAT_CLIPBOARD)
|
||||||
# define FEAT_CLIPBOARD /* include clipboard support */
|
# define FEAT_CLIPBOARD /* include clipboard support */
|
||||||
#endif
|
#endif
|
||||||
#if defined(__DATE__) && defined(__TIME__)
|
#if defined(__DATE__) && defined(__TIME__)
|
||||||
|
@ -352,7 +352,6 @@ free_register(void *reg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* return TRUE if the current yank register has type MLINE
|
* return TRUE if the current yank register has type MLINE
|
||||||
*/
|
*/
|
||||||
@ -366,7 +365,6 @@ yank_register_mline(int regname)
|
|||||||
get_yank_register(regname, FALSE);
|
get_yank_register(regname, FALSE);
|
||||||
return (y_current->y_type == MLINE);
|
return (y_current->y_type == MLINE);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start or stop recording into a yank register.
|
* Start or stop recording into a yank register.
|
||||||
|
57
src/term.c
57
src/term.c
@ -1962,9 +1962,7 @@ set_termname(char_u *term)
|
|||||||
is_mac_terminal = FALSE;
|
is_mac_terminal = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
#if defined(UNIX) || defined(VMS)
|
||||||
# if defined(UNIX) || defined(VMS)
|
|
||||||
# ifdef FEAT_MOUSE_TTY
|
|
||||||
/*
|
/*
|
||||||
* For Unix, set the 'ttymouse' option to the type of mouse to be used.
|
* 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.
|
* The termcode for the mouse is added as a side effect in option.c.
|
||||||
@ -1972,7 +1970,7 @@ set_termname(char_u *term)
|
|||||||
{
|
{
|
||||||
char_u *p = (char_u *)"";
|
char_u *p = (char_u *)"";
|
||||||
|
|
||||||
# ifdef FEAT_MOUSE_XTERM
|
# ifdef FEAT_MOUSE_XTERM
|
||||||
if (use_xterm_like_mouse(term))
|
if (use_xterm_like_mouse(term))
|
||||||
{
|
{
|
||||||
if (use_xterm_mouse())
|
if (use_xterm_mouse())
|
||||||
@ -1980,7 +1978,7 @@ set_termname(char_u *term)
|
|||||||
else
|
else
|
||||||
p = (char_u *)"xterm";
|
p = (char_u *)"xterm";
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
set_option_value((char_u *)"ttym", 0L, p, 0);
|
set_option_value((char_u *)"ttym", 0L, p, 0);
|
||||||
@ -1989,17 +1987,15 @@ set_termname(char_u *term)
|
|||||||
reset_option_was_set((char_u *)"ttym");
|
reset_option_was_set((char_u *)"ttym");
|
||||||
}
|
}
|
||||||
if (p == NULL
|
if (p == NULL
|
||||||
# ifdef FEAT_GUI
|
# ifdef FEAT_GUI
|
||||||
|| gui.in_use
|
|| gui.in_use
|
||||||
# endif
|
# endif
|
||||||
)
|
)
|
||||||
check_mouse_termcode(); /* set mouse termcode anyway */
|
check_mouse_termcode(); /* set mouse termcode anyway */
|
||||||
}
|
}
|
||||||
# endif
|
#else
|
||||||
# else
|
|
||||||
set_mouse_termcode(KS_MOUSE, (char_u *)"\233M");
|
set_mouse_termcode(KS_MOUSE, (char_u *)"\233M");
|
||||||
# endif
|
#endif
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
#ifdef USE_TERM_CONSOLE
|
#ifdef USE_TERM_CONSOLE
|
||||||
/* DEFAULT_TERM indicates that it is the machine console. */
|
/* DEFAULT_TERM indicates that it is the machine console. */
|
||||||
@ -2565,8 +2561,6 @@ out_char_nf(unsigned c)
|
|||||||
out_flush();
|
out_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_TITLE) || defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI) \
|
|
||||||
|| defined(FEAT_TERMRESPONSE) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* A never-padding out_str.
|
* A never-padding out_str.
|
||||||
* use this whenever you don't want to run the string through tputs.
|
* use this whenever you don't want to run the string through tputs.
|
||||||
@ -2590,7 +2584,6 @@ out_str_nf(char_u *s)
|
|||||||
if (p_wd)
|
if (p_wd)
|
||||||
out_flush();
|
out_flush();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A conditional-flushing out_str, mainly for visualbell.
|
* A conditional-flushing out_str, mainly for visualbell.
|
||||||
@ -3151,9 +3144,6 @@ get_long_from_buf(char_u *buf, long_u *val)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
* 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
|
* that buf has been through inchar(). Returns the actual number of bytes used
|
||||||
@ -3191,7 +3181,6 @@ get_bytes_from_buf(char_u *buf, char_u *bytes, int num_bytes)
|
|||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the new shell size is valid, correct it if it's too small or way
|
* Check if the new shell size is valid, correct it if it's too small or way
|
||||||
@ -3436,10 +3425,8 @@ settmode(int tmode)
|
|||||||
check_for_codes_from_term();
|
check_for_codes_from_term();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MOUSE_TTY
|
|
||||||
if (tmode != TMODE_RAW)
|
if (tmode != TMODE_RAW)
|
||||||
mch_setmouse(FALSE); // switch mouse off
|
mch_setmouse(FALSE); // switch mouse off
|
||||||
#endif
|
|
||||||
if (termcap_active)
|
if (termcap_active)
|
||||||
{
|
{
|
||||||
if (tmode != TMODE_RAW)
|
if (tmode != TMODE_RAW)
|
||||||
@ -5084,8 +5071,7 @@ not_enough:
|
|||||||
|
|
||||||
/* We only get here when we have a complete termcode match */
|
/* We only get here when we have a complete termcode match */
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
#ifdef FEAT_GUI
|
||||||
# ifdef FEAT_GUI
|
|
||||||
/*
|
/*
|
||||||
* Only in the GUI: Fetch the pointer coordinates of the scroll event
|
* Only in the GUI: Fetch the pointer coordinates of the scroll event
|
||||||
* so that we know which window to scroll later.
|
* so that we know which window to scroll later.
|
||||||
@ -5109,29 +5095,29 @@ not_enough:
|
|||||||
slen += num_bytes;
|
slen += num_bytes;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* If it is a mouse click, get the coordinates.
|
* If it is a mouse click, get the coordinates.
|
||||||
*/
|
*/
|
||||||
if (key_name[0] == KS_MOUSE
|
if (key_name[0] == KS_MOUSE
|
||||||
# ifdef FEAT_MOUSE_GPM
|
#ifdef FEAT_MOUSE_GPM
|
||||||
|| key_name[0] == KS_GPM_MOUSE
|
|| key_name[0] == KS_GPM_MOUSE
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_JSB
|
#ifdef FEAT_MOUSE_JSB
|
||||||
|| key_name[0] == KS_JSBTERM_MOUSE
|
|| key_name[0] == KS_JSBTERM_MOUSE
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_NET
|
#ifdef FEAT_MOUSE_NET
|
||||||
|| key_name[0] == KS_NETTERM_MOUSE
|
|| key_name[0] == KS_NETTERM_MOUSE
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_DEC
|
#ifdef FEAT_MOUSE_DEC
|
||||||
|| key_name[0] == KS_DEC_MOUSE
|
|| key_name[0] == KS_DEC_MOUSE
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_PTERM
|
#ifdef FEAT_MOUSE_PTERM
|
||||||
|| key_name[0] == KS_PTERM_MOUSE
|
|| key_name[0] == KS_PTERM_MOUSE
|
||||||
# endif
|
#endif
|
||||||
# ifdef FEAT_MOUSE_URXVT
|
#ifdef FEAT_MOUSE_URXVT
|
||||||
|| key_name[0] == KS_URXVT_MOUSE
|
|| key_name[0] == KS_URXVT_MOUSE
|
||||||
# endif
|
#endif
|
||||||
|| key_name[0] == KS_SGR_MOUSE
|
|| key_name[0] == KS_SGR_MOUSE
|
||||||
|| key_name[0] == KS_SGR_MOUSE_RELEASE)
|
|| key_name[0] == KS_SGR_MOUSE_RELEASE)
|
||||||
{
|
{
|
||||||
@ -5139,7 +5125,6 @@ not_enough:
|
|||||||
&modifiers) == -1)
|
&modifiers) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
/*
|
/*
|
||||||
|
@ -926,14 +926,12 @@ f_test_scrollbar(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
void
|
void
|
||||||
f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED)
|
f_test_setmouse(typval_T *argvars, typval_T *rettv UNUSED)
|
||||||
{
|
{
|
||||||
mouse_row = (time_t)tv_get_number(&argvars[0]) - 1;
|
mouse_row = (time_t)tv_get_number(&argvars[0]) - 1;
|
||||||
mouse_col = (time_t)tv_get_number(&argvars[1]) - 1;
|
mouse_col = (time_t)tv_get_number(&argvars[1]) - 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
|
f_test_settime(typval_T *argvars, typval_T *rettv UNUSED)
|
||||||
|
@ -359,15 +359,11 @@ static char *(features[]) =
|
|||||||
"-mksession",
|
"-mksession",
|
||||||
#endif
|
#endif
|
||||||
"+modify_fname",
|
"+modify_fname",
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
"+mouse",
|
"+mouse",
|
||||||
# ifdef FEAT_MOUSESHAPE
|
#ifdef FEAT_MOUSESHAPE
|
||||||
"+mouseshape",
|
"+mouseshape",
|
||||||
# else
|
#else
|
||||||
"-mouseshape",
|
"-mouseshape",
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
"-mouse",
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(UNIX) || defined(VMS)
|
#if defined(UNIX) || defined(VMS)
|
||||||
@ -402,11 +398,7 @@ static char *(features[]) =
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(UNIX) || defined(VMS)
|
#if defined(UNIX) || defined(VMS)
|
||||||
# ifdef FEAT_MOUSE_XTERM
|
|
||||||
"+mouse_sgr",
|
"+mouse_sgr",
|
||||||
# else
|
|
||||||
"-mouse_sgr",
|
|
||||||
# endif
|
|
||||||
# ifdef FEAT_SYSMOUSE
|
# ifdef FEAT_SYSMOUSE
|
||||||
"+mouse_sysmouse",
|
"+mouse_sysmouse",
|
||||||
# else
|
# else
|
||||||
@ -417,11 +409,7 @@ static char *(features[]) =
|
|||||||
# else
|
# else
|
||||||
"-mouse_urxvt",
|
"-mouse_urxvt",
|
||||||
# endif
|
# endif
|
||||||
# ifdef FEAT_MOUSE_XTERM
|
|
||||||
"+mouse_xterm",
|
"+mouse_xterm",
|
||||||
# else
|
|
||||||
"-mouse_xterm",
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MBYTE_IME
|
#ifdef FEAT_MBYTE_IME
|
||||||
@ -753,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2171,
|
||||||
/**/
|
/**/
|
||||||
2170,
|
2170,
|
||||||
/**/
|
/**/
|
||||||
|
81
src/vim.h
81
src/vim.h
@ -151,9 +151,6 @@
|
|||||||
# if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD)
|
# if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD)
|
||||||
# define FEAT_CLIPBOARD
|
# define FEAT_CLIPBOARD
|
||||||
# endif
|
# endif
|
||||||
# if defined(FEAT_SMALL) && !defined(FEAT_MOUSE)
|
|
||||||
# define FEAT_MOUSE
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// +x11 is only enabled when it's both available and wanted.
|
// +x11 is only enabled when it's both available and wanted.
|
||||||
@ -1817,80 +1814,78 @@ typedef int sock_T;
|
|||||||
#define PROF_YES 1 // profiling busy
|
#define PROF_YES 1 // profiling busy
|
||||||
#define PROF_PAUSED 2 // profiling paused
|
#define PROF_PAUSED 2 // profiling paused
|
||||||
|
|
||||||
#ifdef FEAT_MOUSE
|
|
||||||
|
|
||||||
// Codes for mouse button events in lower three bits:
|
// Codes for mouse button events in lower three bits:
|
||||||
# define MOUSE_LEFT 0x00
|
#define MOUSE_LEFT 0x00
|
||||||
# define MOUSE_MIDDLE 0x01
|
#define MOUSE_MIDDLE 0x01
|
||||||
# define MOUSE_RIGHT 0x02
|
#define MOUSE_RIGHT 0x02
|
||||||
# define MOUSE_RELEASE 0x03
|
#define MOUSE_RELEASE 0x03
|
||||||
|
|
||||||
// bit masks for modifiers:
|
// bit masks for modifiers:
|
||||||
# define MOUSE_SHIFT 0x04
|
#define MOUSE_SHIFT 0x04
|
||||||
# define MOUSE_ALT 0x08
|
#define MOUSE_ALT 0x08
|
||||||
# define MOUSE_CTRL 0x10
|
#define MOUSE_CTRL 0x10
|
||||||
|
|
||||||
// mouse buttons that are handled like a key press (GUI only)
|
// 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
|
// 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
|
// the result of this is that the window moves down, similarly MOUSE_6 scrolls
|
||||||
// columns left but the window moves right.
|
// columns left but the window moves right.
|
||||||
# define MOUSE_4 0x100 // scroll wheel down
|
#define MOUSE_4 0x100 // scroll wheel down
|
||||||
# define MOUSE_5 0x200 // scroll wheel up
|
#define MOUSE_5 0x200 // scroll wheel up
|
||||||
|
|
||||||
# define MOUSE_X1 0x300 // Mouse-button X1 (6th)
|
#define MOUSE_X1 0x300 // Mouse-button X1 (6th)
|
||||||
# define MOUSE_X2 0x400 // Mouse-button X2
|
#define MOUSE_X2 0x400 // Mouse-button X2
|
||||||
|
|
||||||
# define MOUSE_6 0x500 // scroll wheel left
|
#define MOUSE_6 0x500 // scroll wheel left
|
||||||
# define MOUSE_7 0x600 // scroll wheel right
|
#define MOUSE_7 0x600 // scroll wheel right
|
||||||
|
|
||||||
// 0x20 is reserved by xterm
|
// 0x20 is reserved by xterm
|
||||||
# define MOUSE_DRAG_XTERM 0x40
|
#define MOUSE_DRAG_XTERM 0x40
|
||||||
|
|
||||||
# define MOUSE_DRAG (0x40 | MOUSE_RELEASE)
|
#define MOUSE_DRAG (0x40 | MOUSE_RELEASE)
|
||||||
|
|
||||||
// Lowest button code for using the mouse wheel (xterm only)
|
// Lowest button code for using the mouse wheel (xterm only)
|
||||||
# define MOUSEWHEEL_LOW 0x60
|
#define MOUSEWHEEL_LOW 0x60
|
||||||
|
|
||||||
# define MOUSE_CLICK_MASK 0x03
|
#define MOUSE_CLICK_MASK 0x03
|
||||||
|
|
||||||
# define NUM_MOUSE_CLICKS(code) \
|
#define NUM_MOUSE_CLICKS(code) \
|
||||||
(((unsigned)((code) & 0xC0) >> 6) + 1)
|
(((unsigned)((code) & 0xC0) >> 6) + 1)
|
||||||
|
|
||||||
# define SET_NUM_MOUSE_CLICKS(code, num) \
|
#define SET_NUM_MOUSE_CLICKS(code, num) \
|
||||||
(code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6)
|
(code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6)
|
||||||
|
|
||||||
// Added to mouse column for GUI when 'mousefocus' wants to give focus to a
|
// 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 *
|
// window by simulating a click on its status line. We could use up to 128 *
|
||||||
// 128 = 16384 columns, now it's reduced to 10000.
|
// 128 = 16384 columns, now it's reduced to 10000.
|
||||||
# define MOUSE_COLOFF 10000
|
#define MOUSE_COLOFF 10000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* jump_to_mouse() returns one of first four these values, possibly with
|
* jump_to_mouse() returns one of first four these values, possibly with
|
||||||
* some of the other three added.
|
* some of the other three added.
|
||||||
*/
|
*/
|
||||||
# define IN_UNKNOWN 0
|
#define IN_UNKNOWN 0
|
||||||
# define IN_BUFFER 1
|
#define IN_BUFFER 1
|
||||||
# define IN_STATUS_LINE 2 // on status or command line
|
#define IN_STATUS_LINE 2 // on status or command line
|
||||||
# define IN_SEP_LINE 4 // on vertical separator line
|
#define IN_SEP_LINE 4 // on vertical separator line
|
||||||
# define IN_OTHER_WIN 8 // in other window but can't go there
|
#define IN_OTHER_WIN 8 // in other window but can't go there
|
||||||
# define CURSOR_MOVED 0x100
|
#define CURSOR_MOVED 0x100
|
||||||
# define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column
|
#define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column
|
||||||
# define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column
|
#define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column
|
||||||
# define MOUSE_WINBAR 0x800 // in window toolbar
|
#define MOUSE_WINBAR 0x800 // in window toolbar
|
||||||
|
|
||||||
// flags for jump_to_mouse()
|
// flags for jump_to_mouse()
|
||||||
# define MOUSE_FOCUS 0x01 // need to stay in this window
|
#define MOUSE_FOCUS 0x01 // need to stay in this window
|
||||||
# define MOUSE_MAY_VIS 0x02 // may start Visual mode
|
#define MOUSE_MAY_VIS 0x02 // may start Visual mode
|
||||||
# define MOUSE_DID_MOVE 0x04 // only act when mouse has moved
|
#define MOUSE_DID_MOVE 0x04 // only act when mouse has moved
|
||||||
# define MOUSE_SETPOS 0x08 // only set current mouse position
|
#define MOUSE_SETPOS 0x08 // only set current mouse position
|
||||||
# define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode
|
#define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode
|
||||||
# define MOUSE_RELEASED 0x20 // button was released
|
#define MOUSE_RELEASED 0x20 // button was released
|
||||||
|
|
||||||
# if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
#if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||||
# define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves.
|
# define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves.
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
#endif // FEAT_MOUSE
|
|
||||||
|
|
||||||
// defines for eval_vars()
|
// defines for eval_vars()
|
||||||
#define VALID_PATH 1
|
#define VALID_PATH 1
|
||||||
|
@ -5725,8 +5725,6 @@ win_setminwidth(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status line of dragwin is dragged "offset" lines down (negative is up).
|
* Status line of dragwin is dragged "offset" lines down (negative is up).
|
||||||
*/
|
*/
|
||||||
@ -5958,7 +5956,6 @@ win_drag_vsep_line(win_T *dragwin, int offset)
|
|||||||
(void)win_comp_pos();
|
(void)win_comp_pos();
|
||||||
redraw_all_later(NOT_VALID);
|
redraw_all_later(NOT_VALID);
|
||||||
}
|
}
|
||||||
#endif /* FEAT_MOUSE */
|
|
||||||
|
|
||||||
#define FRACTION_MULT 16384L
|
#define FRACTION_MULT 16384L
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user