Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2019-10-22 01:37:59 -07:00
76 changed files with 1130 additions and 546 deletions
+1
View File
@@ -0,0 +1 @@
src/testdir/test42.in diff
+1
View File
@@ -4,6 +4,7 @@
# source files for all source archives
SRC_ALL = \
.gitignore \
.gitattributes \
.hgignore \
.lgtm.yml \
.travis.yml \
+22 -1
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.1. Last change: 2019 Sep 27
*insert.txt* For Vim version 8.1. Last change: 2019 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1138,6 +1138,27 @@ below the text, and the bottom of the menu otherwise.
After the info popup is created it can be found with |popup_findinfo()| and
properties can be changed with |popup_setoptions()|.
*complete-popuphidden*
If the information for the popup is obtained asynchronously, use "popuphidden"
in 'completeopt'. The info popup will then be initally hidden and
|popup_show()| must be called once it has been filled with the info. This can
be done with a |CompleteChanged| autocommand, something like this: >
set completeopt+=popuphidden
au CompleteChanged * call UpdateCompleteInfo()
func UpdateCompleteInfo()
" Cancel any pending info fetch
let item = v:event.completed_item
" Start fetching info for the item then call ShowCompleteInfo(info)
endfunc
func ShowCompleteInfo(info)
let id = popup_findinfo()
if id
call popup_settext(id, 'async info: ' .. a:info)
call popup_show(id)
endif
endfunc
< *complete-item-kind*
The "kind" item uses a single letter to indicate the kind of completion. This
may be used to show the completion differently (different color or icon).
Currently these types can be used:
+30 -2
View File
@@ -20,7 +20,8 @@ manual.
1.8 Examples |map-examples|
1.9 Using mappings |map-typing|
1.10 Mapping alt-keys |:map-alt-keys|
1.11 Mapping an operator |:map-operator|
1.11 Mapping in modifyOtherKeys mode |modifyOtherKeys|
1.12 Mapping an operator |:map-operator|
2. Abbreviations |abbreviations|
3. Local mappings and functions |script-local|
4. User-defined commands |user-commands|
@@ -777,6 +778,9 @@ In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
always work. But in a terminal Vim gets a sequence of bytes and has to figure
out whether ALT was pressed or not.
If the terminal supports the modifyOtherKeys mode and it has been enabled,
then Vim can recognize more key combinations, see |modifyOtherKeys| below.
By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
character. Most decent terminals can work that way, such as xterm, aterm and
rxvt. If your <A-k> mappings don't work it might be that the terminal is
@@ -814,7 +818,31 @@ on the terminal; that's a good last resource in case you want to send ESC when
using other applications but not when inside Vim.
1.11 MAPPING AN OPERATOR *:map-operator*
1.11 MAPPING IN modifyOtherKeys mode *modifyOtherKeys*
Xterm and a few other terminals can be put in a mode where keys with modifiers
are sent with a special escape code. Vim recognizes these codes and can then
make a difference between CTRL-H and Backspace, even when Backspace sends the
character 8. And many more special keys.
For xterm modifyOtherKeys is enabled in the builtin termcap entry. If this is
not used you can enable modifyOtherKeys with these lines in your vimrc: >
let &t_TI = "\<Esc>[>4;2m"
let &t_TE = "\<Esc>[>4;m"
In case the modifyOtherKeys mode causes problems you can disable it: >
let &t_TI = ""
let &t_TE = ""
It does not take effect immediately. To have this work without restarting Vim
execute a shell command, e.g.: `!ls`
A known side effect effect is that in Insert mode the raw escape sequence is
inserted after the CTRL-V key. This can be used to check whether
modifyOtherKeys is enabled: In Insert mode type CTRL-V CTRL-V, if you get
one byte then modifyOtherKeys is off, if you get <1b>27;5;118~ then it is on.
1.12 MAPPING AN OPERATOR *:map-operator*
An operator is used before a {motion} command. To define your own operator
you must create mapping that first sets the 'operatorfunc' option and then
+2 -1
View File
@@ -582,7 +582,8 @@ allowed for the command that was used.
Vim was not able to create a swap file. You can still edit the file, but if
Vim unexpectedly exits the changes will be lost. And Vim may consume a lot of
memory when editing a big file. You may want to change the 'directory' option
to avoid this error. See |swap-file|.
to avoid this error. This error is not given when 'directory' is empty. See
|swap-file|.
*E140* >
Use ! to write partial buffer
+9 -2
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.1. Last change: 2019 Sep 28
*options.txt* For Vim version 8.1. Last change: 2019 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1942,6 +1942,13 @@ A jump table for the options with a short description can be found at |Q_op|.
See |'completepopup'| for specifying properties.
{only works when compiled with the |+textprop| feature}
popuphidden
Just like "popup" but initially hide the popup. Use a
|CompleteChanged| autocommand to fetch the info and call
|popup_show()| once the popup has been filled.
See the example at |complete-popuphidden|.
{only works when compiled with the |+textprop| feature}
noinsert Do not insert any text for a match until the user selects
a match from the menu. Only works in combination with
"menu" or "menuone". No effect if "longest" is present.
@@ -2716,7 +2723,7 @@ A jump table for the options with a short description can be found at |Q_op|.
- The swap file will be created in the first directory where this is
possible.
- Empty means that no swap file will be used (recovery is
impossible!).
impossible!) and no |E303| error will be given.
- A directory "." means to put the swap file in the same directory as
the edited file. On Unix, a dot is prepended to the file name, so
it doesn't show in a directory listing. On MS-Windows the "hidden"
+7
View File
@@ -474,6 +474,8 @@ popup_notification({what}, {options}) *popup_notification()*
popup_show({id}) *popup_show()*
If {id} is a hidden popup, show it now.
For {id} see `popup_hide()`.
If {id} is the info popup it will be positioned next to the
current popup menu item.
popup_setoptions({id}, {options}) *popup_setoptions()*
@@ -680,8 +682,13 @@ The second argument of |popup_create()| is a dictionary with options:
- "expr": if the cursor moved outside |<cexpr>|
- [{start}, {end}]: if the cursor moved before column
{start} or after {end}
- [{lnum}, {start}, {end}]: if the cursor moved away
from line {lnum}, before column {start} or after
{end}
The popup also closes if the cursor moves to another
line or to another window.
mousemoved Like "moved" but referring to the mouse pointer
position
cursorline non-zero: Highlight the cursor line. Also scrolls the
text to show this line (only works properly
when 'wrap' is off).
+7
View File
@@ -193,6 +193,7 @@ Command syntax ~
Supported [options] are:
++close The terminal window will close
automatically when the job terminates.
|terminal-close|
++noclose The terminal window will NOT close
automatically when the job terminates.
++open When the job terminates and no window
@@ -267,6 +268,12 @@ hidden, the job keeps running. The `:buffer` command can be used to turn the
current window into a terminal window. If there are unsaved changes this
fails, use ! to force, as usual.
*terminal-close*
When the terminal window is closed, e.g. when the shell exits and "++close"
argument was used, and this is the last normal Vim window, then Vim will exit.
This is like using |:quit| in a normal window. Help and preview windows are
not counted.
To have a background job run without a window, and open the window when it's
done, use options like this: >
:term ++hidden ++open make
+6
View File
@@ -425,6 +425,9 @@ au BufNewFile,BufRead *.csp,*.fdr setf csp
au BufNewFile,BufRead *.pld setf cupl
au BufNewFile,BufRead *.si setf cuplsim
" Dart
au BufRead,BufNewfile *.dart,*.drt setf dart
" Debian Control
au BufNewFile,BufRead */debian/control setf debcontrol
au BufNewFile,BufRead control
@@ -979,6 +982,9 @@ au BufNewFile,BufRead hg-editor-*.txt setf hgcommit
" Mercurial config (looks like generic config file)
au BufNewFile,BufRead *.hgrc,*hgrc setf cfg
" Meson Build system config
au BufNewFile,BufRead meson.build,meson_options.txt setf meson
" Messages (logs mostly)
au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages
+27 -6
View File
@@ -1279,6 +1279,17 @@ MAIN_TARGET = $(GVIM).exe $(VIM).exe $(VIMDLLBASE).dll
MAIN_TARGET = $(VIM).exe
!endif
# Target to run individual tests.
VIMTESTTARGET = $(VIM).exe
OLD_TEST_OUTFILES = \
$(SCRIPTS_FIRST) \
$(SCRIPTS_ALL) \
$(SCRIPTS_MORE1) \
$(SCRIPTS_MORE4) \
$(SCRIPTS_WIN32) \
$(SCRIPTS_GUI)
all: $(MAIN_TARGET) \
vimrun.exe \
install.exe \
@@ -1370,7 +1381,7 @@ tags: notags
notags:
- if exist tags del tags
clean:
clean: testclean
- if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
- if exist *.obj del *.obj
- if exist $(VIM).exe del $(VIM).exe
@@ -1405,7 +1416,6 @@ clean:
cd GvimExt
$(MAKE) /NOLOGO -f Makefile clean
cd ..
- if exist testdir\*.out del testdir\*.out
test:
cd testdir
@@ -1422,13 +1432,24 @@ testclean:
$(MAKE) /NOLOGO -f Make_dos.mak clean
cd ..
# Run individual OLD style test.
# These do not depend on the executable, compile it when needed.
$(OLD_TEST_OUTFILES:.out=):
cd testdir
- if exist $@.out del $@.out
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $@.out
@ if exist test.log ( type test.log & exit /b 1 )
cd ..
# Run individual NEW style test.
# These do not depend on the executable, compile it when needed.
$(NEW_TESTS):
cd testdir
- if exist $@.res del $@.res
$(MAKE) /NOLOGO -f Make_dos.mak nolog
$(MAKE) /NOLOGO -f Make_dos.mak $@.res
$(MAKE) /NOLOGO -f Make_dos.mak report
type messages
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) nolog
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) $@.res
$(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\$(VIMTESTTARGET) report
cd ..
###########################################################################
+2
View File
@@ -1985,6 +1985,8 @@ ExpandFromContext(
flags |= EW_KEEPALL;
if (options & WILD_SILENT)
flags |= EW_SILENT;
if (options & WILD_NOERROR)
flags |= EW_NOERROR;
if (options & WILD_ALLLINKS)
flags |= EW_ALLLINKS;
+25 -16
View File
@@ -1399,14 +1399,14 @@ win_line(
}
#endif
if (extra_check)
#ifdef FEAT_SYN_HL
if (extra_check && n_extra == 0)
{
#ifdef FEAT_TERMINAL
syntax_attr = 0;
# ifdef FEAT_TERMINAL
if (get_term_attr)
syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol);
#endif
#ifdef FEAT_SYN_HL
# endif
// Get syntax attribute.
if (has_syntax)
{
@@ -1463,16 +1463,28 @@ win_line(
syntax_flags = get_syntax_info(&syntax_seqnr);
# endif
}
#endif
}
#endif
// Decide which of the highlight attributes to use.
attr_pri = TRUE;
#ifdef LINE_ATTR
if (area_attr != 0)
{
char_attr = hl_combine_attr(line_attr, area_attr);
# ifdef FEAT_SYN_HL
if (syntax_attr != 0)
char_attr = hl_combine_attr(syntax_attr, char_attr);
# endif
}
else if (search_attr != 0)
{
char_attr = hl_combine_attr(line_attr, search_attr);
# ifdef FEAT_SYN_HL
if (syntax_attr != 0)
char_attr = hl_combine_attr(syntax_attr, char_attr);
# endif
}
# ifdef FEAT_TEXT_PROP
else if (text_prop_type != NULL)
{
@@ -1490,7 +1502,7 @@ win_line(
// Use line_attr when not in the Visual or 'incsearch' area
// (area_attr may be 0 when "noinvcur" is set).
# ifdef FEAT_SYN_HL
if (has_syntax)
if (syntax_attr != 0)
char_attr = hl_combine_attr(syntax_attr, line_attr);
else
# endif
@@ -1519,15 +1531,10 @@ win_line(
else
#endif
#ifdef FEAT_SYN_HL
if (has_syntax
# ifdef FEAT_TERMINAL
|| get_term_attr
# endif
)
char_attr = syntax_attr;
else
#endif
char_attr = syntax_attr;
#else
char_attr = 0;
#endif
}
}
if (char_attr == 0)
@@ -1824,6 +1831,7 @@ win_line(
// Only do this when there is no syntax highlighting, the
// @Spell cluster is not used or the current syntax item
// contains the @Spell cluster.
v = (long)(ptr - line);
if (has_spell && v >= word_end && v > cur_checked_col)
{
spell_attr = 0;
@@ -1874,7 +1882,8 @@ win_line(
// Remember that the good word continues at the
// start of the next line.
checked_lnum = lnum + 1;
checked_col = (int)((p - nextline) + len - nextline_idx);
checked_col = (int)((p - nextline)
+ len - nextline_idx);
}
// Turn index into actual attributes.
+1 -9
View File
@@ -235,7 +235,6 @@ edit(
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.
@@ -243,7 +242,6 @@ edit(
if (where_paste_started.lnum != 0)
Insstart = where_paste_started;
else
#endif
{
Insstart = curwin->w_cursor;
if (startln)
@@ -336,7 +334,6 @@ edit(
*/
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.
@@ -344,7 +341,6 @@ edit(
if (where_paste_started.lnum)
arrow_used = FALSE;
else
#endif
arrow_used = TRUE;
restart_edit = 0;
@@ -381,9 +377,7 @@ edit(
/* 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
@@ -980,7 +974,6 @@ doESCkey:
inserted_space = FALSE;
break;
#ifdef FEAT_MOUSE
case K_LEFTMOUSE: /* mouse keys */
case K_LEFTMOUSE_NM:
case K_LEFTDRAG:
@@ -1018,7 +1011,7 @@ doESCkey:
ins_mousescroll(MSCR_RIGHT);
break;
# ifdef FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
/* Gestures are ignored */
case K_SWIPELEFT:
case K_SWIPERIGHT:
@@ -1026,7 +1019,6 @@ doESCkey:
case K_SWIPEDOWN:
case K_FORCECLICK:
break;
# endif
#endif
case K_PS:
bracketed_paste(PASTE_INSERT, FALSE, NULL);
+18 -7
View File
@@ -815,9 +815,7 @@ static funcentry_T global_functions[] =
#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},
@@ -3439,9 +3437,7 @@ f_has(typval_T *argvars, typval_T *rettv)
"mksession",
#endif
"modify_fname",
#ifdef FEAT_MOUSE
"mouse",
#endif
#ifdef FEAT_MOUSESHAPE
"mouseshape",
#endif
@@ -5721,12 +5717,13 @@ search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
int dir;
int retval = 0; /* default: FAIL */
long lnum_stop = 0;
proftime_T tm;
#ifdef FEAT_RELTIME
proftime_T tm;
long time_limit = 0;
#endif
int options = SEARCH_KEEP;
int subpatnum;
searchit_arg_T sia;
pat = tv_get_string(&argvars[0]);
dir = get_search_arg(&argvars[1], flagsp); /* may set p_ws */
@@ -5775,8 +5772,13 @@ search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
}
pos = save_cursor = curwin->w_cursor;
vim_memset(&sia, 0, sizeof(sia));
sia.sa_stop_lnum = (linenr_T)lnum_stop;
#ifdef FEAT_RELTIME
sia.sa_tm = &tm;
#endif
subpatnum = searchit(curwin, curbuf, &pos, NULL, dir, pat, 1L,
options, RE_SEARCH, (linenr_T)lnum_stop, &tm, NULL);
options, RE_SEARCH, &sia);
if (subpatnum != FAIL)
{
if (flags & SP_SUBPAT)
@@ -6174,7 +6176,9 @@ do_searchpair(
int use_skip = FALSE;
int err;
int options = SEARCH_KEEP;
#ifdef FEAT_RELTIME
proftime_T tm;
#endif
/* Make 'cpoptions' empty, the 'l' flag should not be used here. */
save_cpo = p_cpo;
@@ -6215,8 +6219,15 @@ do_searchpair(
pat = pat3;
for (;;)
{
searchit_arg_T sia;
vim_memset(&sia, 0, sizeof(sia));
sia.sa_stop_lnum = lnum_stop;
#ifdef FEAT_RELTIME
sia.sa_tm = &tm;
#endif
n = searchit(curwin, curbuf, &pos, NULL, dir, pat, 1L,
options, RE_SEARCH, lnum_stop, &tm, NULL);
options, RE_SEARCH, &sia);
if (n == FAIL || (firstpos.lnum != 0 && EQUAL_POS(pos, firstpos)))
/* didn't find it or found the first match again: FAIL */
break;
+21 -9
View File
@@ -251,18 +251,23 @@ linelen(int *has_tab)
int save;
int len;
/* find the first non-blank character */
// Get the line. If it's empty bail out early (could be the empty string
// for an unloaded buffer).
line = ml_get_curline();
if (*line == NUL)
return 0;
// find the first non-blank character
first = skipwhite(line);
/* find the character after the last non-blank character */
// find the character after the last non-blank character
for (last = first + STRLEN(first);
last > first && VIM_ISWHITE(last[-1]); --last)
;
save = *last;
*last = NUL;
len = linetabsize(line); /* get line length */
if (has_tab != NULL) /* check for embedded TAB */
len = linetabsize(line); // get line length
if (has_tab != NULL) // check for embedded TAB
*has_tab = (vim_strchr(first, TAB) != NULL);
*last = save;
@@ -4919,13 +4924,14 @@ free_old_sub(void)
#if defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Set up for a tagpreview.
* Makes the preview window the current window.
* Return TRUE when it was created.
*/
int
prepare_tagpreview(
int undo_sync, // sync undo when leaving the window
int use_previewpopup, // use popup if 'previewpopup' set
int use_popup) // use other popup window
use_popup_T use_popup) // use other popup window
{
win_T *wp;
@@ -4945,11 +4951,16 @@ prepare_tagpreview(
if (wp != NULL)
popup_set_wantpos_cursor(wp, wp->w_minwidth);
}
else if (use_popup)
else if (use_popup != USEPOPUP_NONE)
{
wp = popup_find_info_window();
if (wp != NULL)
popup_show(wp);
{
if (use_popup == USEPOPUP_NORMAL)
popup_show(wp);
else
popup_hide(wp);
}
}
else
# endif
@@ -4966,8 +4977,9 @@ prepare_tagpreview(
* There is no preview window open yet. Create one.
*/
# ifdef FEAT_TEXT_PROP
if ((use_previewpopup && *p_pvp != NUL) || use_popup)
return popup_create_preview_window(use_popup);
if ((use_previewpopup && *p_pvp != NUL)
|| use_popup != USEPOPUP_NONE)
return popup_create_preview_window(use_popup != USEPOPUP_NONE);
# endif
if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)
return FALSE;
+13 -12
View File
@@ -87,7 +87,6 @@ static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep);
static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep);
static void ex_highlight(exarg_T *eap);
static void ex_colorscheme(exarg_T *eap);
static void ex_quit(exarg_T *eap);
static void ex_cquit(exarg_T *eap);
static void ex_quit_all(exarg_T *eap);
static void ex_close(exarg_T *eap);
@@ -3606,7 +3605,7 @@ get_address(
curwin->w_cursor.col = 0;
searchcmdlen = 0;
flags = silent ? 0 : SEARCH_HIS | SEARCH_MSG;
if (!do_search(NULL, c, cmd, 1L, flags, NULL, NULL))
if (!do_search(NULL, c, cmd, 1L, flags, NULL))
{
curwin->w_cursor = pos;
cmd = NULL;
@@ -3660,8 +3659,7 @@ get_address(
pos.coladd = 0;
if (searchit(curwin, curbuf, &pos, NULL,
*cmd == '?' ? BACKWARD : FORWARD,
(char_u *)"", 1L, SEARCH_MSG,
i, (linenr_T)0, NULL, NULL) != FAIL)
(char_u *)"", 1L, SEARCH_MSG, i, NULL) != FAIL)
lnum = pos.lnum;
else
{
@@ -4218,7 +4216,8 @@ expand_filename(
else /* n == 2 */
{
expand_T xpc;
int options = WILD_LIST_NOTFOUND|WILD_ADD_SLASH;
int options = WILD_LIST_NOTFOUND
| WILD_NOERROR | WILD_ADD_SLASH;
ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
@@ -4824,9 +4823,9 @@ before_quit_autocmds(win_T *wp, int quit_all, int forceit)
{
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, wp->w_buffer);
/* Bail out when autocommands closed the window.
* Refuse to quit when the buffer in the last window is being closed (can
* only happen in autocommands). */
// Bail out when autocommands closed the window.
// Refuse to quit when the buffer in the last window is being closed (can
// only happen in autocommands).
if (!win_valid(wp)
|| curbuf_locked()
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
@@ -4835,9 +4834,10 @@ before_quit_autocmds(win_T *wp, int quit_all, int forceit)
if (quit_all || (check_more(FALSE, forceit) == OK && only_one_window()))
{
apply_autocmds(EVENT_EXITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked()
// Refuse to quit when locked or when the window was closed or the
// buffer in the last window is being closed (can only happen in
// autocommands).
if (!win_valid(wp) || curbuf_locked()
|| (curbuf->b_nwindows == 1 && curbuf->b_locked > 0))
return TRUE;
}
@@ -4848,8 +4848,9 @@ before_quit_autocmds(win_T *wp, int quit_all, int forceit)
/*
* ":quit": quit current window, quit Vim if the last window is closed.
* ":{nr}quit": quit window {nr}
* Also used when closing a terminal window that's the last one.
*/
static void
void
ex_quit(exarg_T *eap)
{
win_T *wp;
+13 -18
View File
@@ -373,6 +373,7 @@ may_do_incsearch_highlighting(
pos_T end_pos;
#ifdef FEAT_RELTIME
proftime_T tm;
searchit_arg_T sia;
#endif
int next_char;
int use_last_pat;
@@ -445,12 +446,16 @@ may_do_incsearch_highlighting(
if (search_first_line != 0)
search_flags += SEARCH_START;
ccline.cmdbuff[skiplen + patlen] = NUL;
#ifdef FEAT_RELTIME
vim_memset(&sia, 0, sizeof(sia));
sia.sa_tm = &tm;
#endif
found = do_search(NULL, firstc == ':' ? '/' : firstc,
ccline.cmdbuff + skiplen, count, search_flags,
#ifdef FEAT_RELTIME
&tm, NULL
&sia
#else
NULL, NULL
NULL
#endif
);
ccline.cmdbuff[skiplen + patlen] = next_char;
@@ -597,8 +602,7 @@ may_adjust_incsearch_highlighting(
pat[patlen] = NUL;
i = searchit(curwin, curbuf, &t, NULL,
c == Ctrl_G ? FORWARD : BACKWARD,
pat, count, search_flags,
RE_SEARCH, 0, NULL, NULL);
pat, count, search_flags, RE_SEARCH, NULL);
--emsg_off;
pat[patlen] = save;
if (i)
@@ -795,11 +799,9 @@ getcmdline_int(
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
@@ -1856,7 +1858,6 @@ getcmdline_int(
break;
#endif
#ifdef FEAT_MOUSE
case K_MIDDLEDRAG:
case K_MIDDLERELEASE:
goto cmdline_not_changed; /* Ignore mouse */
@@ -1961,7 +1962,7 @@ getcmdline_int(
case K_MOUSEMOVE:
goto cmdline_not_changed;
# ifdef FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
/* Gestures are ignored */
case K_SWIPELEFT:
case K_SWIPERIGHT:
@@ -1969,9 +1970,7 @@ getcmdline_int(
case K_SWIPEDOWN:
case K_FORCECLICK:
goto cmdline_not_changed;
# endif
#endif /* FEAT_MOUSE */
#endif
#ifdef FEAT_GUI
case K_LEFTMOUSE_NM: /* mousefocus click, ignored */
case K_LEFTRELEASE_NM:
@@ -2204,9 +2203,7 @@ getcmdline_int(
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 */
@@ -2222,13 +2219,11 @@ getcmdline_int(
#ifdef FEAT_DIGRAPHS
case Ctrl_K:
#ifdef FEAT_MOUSE
ignore_drag_release = TRUE;
#endif
putcmdline('?', TRUE);
#ifdef USE_ON_FLY_SCROLL
# ifdef USE_ON_FLY_SCROLL
dont_scroll = TRUE; /* disallow scrolling here */
#endif
# endif
c = get_digraph(TRUE);
extra_char = NUL;
if (c != NUL)
@@ -2236,7 +2231,7 @@ getcmdline_int(
redrawcmd();
goto cmdline_not_changed;
#endif /* FEAT_DIGRAPHS */
#endif // FEAT_DIGRAPHS
#ifdef FEAT_RIGHTLEFT
case Ctrl__: /* CTRL-_: switch language mode */
+31 -45
View File
@@ -429,18 +429,6 @@
# define FEAT_CONCEAL
#endif
/*
* +textprop Text properties and popup windows
*/
#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
# define FEAT_TEXT_PROP
#endif
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
// Can limit syntax highlight time to 'redrawtime'.
# define SYN_TIME_LIMIT 1
#endif
/*
* +spell spell checking
*
@@ -975,12 +963,12 @@
* 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(AMIGA)
# ifdef FEAT_NORMAL
# define FEAT_MOUSE_XTERM
# endif
#if defined(UNIX) || defined(VMS)
# define FEAT_MOUSE_XTERM
# ifdef FEAT_BIG
# define FEAT_MOUSE_NET
# endif
@@ -990,12 +978,12 @@
# 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
#if defined(MSWIN)
# define DOS_MOUSE
#endif
#if defined(__QNX__)
# define FEAT_MOUSE_PTERM
#endif
/*
@@ -1013,28 +1001,11 @@
# define FEAT_SYSMOUSE
#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)
# 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
@@ -1110,7 +1081,7 @@
* 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)
#if defined(HAVE_TGETENT)
# define FEAT_TERMRESPONSE
#endif
@@ -1153,10 +1124,6 @@
# define FEAT_ARP
#endif
/*
* +GUI_Athena To compile Vim with or without the GUI (gvim) you have
* +GUI_Motif to edit the Makefile.
*/
/*
* +ole Win32 OLE automation: Use Makefile.ovc.
@@ -1172,6 +1139,8 @@
* +tcl TCL interface: "--enable-tclinterp"
* +netbeans_intg Netbeans integration
* +channel Inter process communication
* +GUI_Athena Athena GUI
* +GUI_Motif Motif GUI
*/
/*
@@ -1204,6 +1173,23 @@
#if defined(FEAT_TERMINAL) && !defined(CURSOR_SHAPE)
# define CURSOR_SHAPE
#endif
#if defined(FEAT_TERMINAL) && !defined(FEAT_SYN_HL)
// simplify the code a bit by enabling +syntax when +terminal is enabled
# define FEAT_SYN_HL
#endif
/*
* +textprop Text properties and popup windows
*/
#if defined(FEAT_EVAL) && defined(FEAT_SYN_HL)
# define FEAT_TEXT_PROP
#endif
#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME)
// Can limit syntax highlight time to 'redrawtime'.
# define SYN_TIME_LIMIT 1
#endif
/*
* +signs Allow signs to be displayed to the left of text lines.
+23 -13
View File
@@ -1325,10 +1325,8 @@ save_typebuf(void)
static int old_char = -1; /* character put back by vungetc() */
static int old_mod_mask; /* mod_mask for ungotten character */
#ifdef FEAT_MOUSE
static int old_mouse_row; /* mouse_row related to old_char */
static int old_mouse_col; /* mouse_col related to old_char */
#endif
/*
* Save all three kinds of typeahead, so that the user must type at a prompt.
@@ -1559,10 +1557,8 @@ vgetc(void)
c = old_char;
old_char = -1;
mod_mask = old_mod_mask;
#ifdef FEAT_MOUSE
mouse_row = old_mouse_row;
mouse_col = old_mouse_col;
#endif
}
else
{
@@ -2007,15 +2003,14 @@ f_getchar(typval_T *argvars, typval_T *rettv)
rettv->v_type = VAR_STRING;
rettv->vval.v_string = vim_strsave(temp);
#ifdef FEAT_MOUSE
if (is_mouse_key(n)
# ifdef FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
|| n == K_SWIPELEFT
|| n == K_SWIPERIGHT
|| n == K_SWIPEUP
|| n == K_SWIPEDOWN
|| n == K_FORCECLICK
# endif
#endif
)
{
int row = mouse_row;
@@ -2033,11 +2028,11 @@ f_getchar(typval_T *argvars, typval_T *rettv)
if (win == NULL)
return;
(void)mouse_comp_pos(win, &row, &col, &lnum, NULL);
# ifdef FEAT_TEXT_PROP
#ifdef FEAT_TEXT_PROP
if (WIN_IS_POPUP(win))
winnr = 0;
else
# endif
#endif
for (wp = firstwin; wp != win && wp != NULL;
wp = wp->w_next)
++winnr;
@@ -2047,7 +2042,6 @@ f_getchar(typval_T *argvars, typval_T *rettv)
set_vim_var_nr(VV_MOUSE_COL, col + 1);
}
}
#endif
}
}
@@ -2161,6 +2155,24 @@ typedef enum {
map_result_nomatch // no matching mapping, get char
} map_result_T;
/*
* Check if the bytes at the start of the typeahead buffer are a character used
* in CTRL-X mode. This includes the form with a CTRL modifier.
*/
static int
at_ctrl_x_key(void)
{
char_u *p = typebuf.tb_buf + typebuf.tb_off;
int c = *p;
if (typebuf.tb_len > 3
&& c == K_SPECIAL
&& p[1] == KS_MODIFIER
&& (p[2] & MOD_MASK_CTRL))
c = p[3] & 0x1f;
return vim_is_ctrl_x_key(c);
}
/*
* Handle mappings in the typeahead buffer.
* - When something was mapped, return map_result_retry for recursive mappings.
@@ -2212,7 +2224,7 @@ handle_mapping(
&& !(State == HITRETURN && (tb_c1 == CAR || tb_c1 == ' '))
&& State != ASKMORE
&& State != CONFIRM
&& !((ctrl_x_mode_not_default() && vim_is_ctrl_x_key(tb_c1))
&& !((ctrl_x_mode_not_default() && at_ctrl_x_key())
|| ((compl_cont_status & CONT_LOCAL)
&& (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P))))
{
@@ -2649,10 +2661,8 @@ vungetc(int c)
{
old_char = c;
old_mod_mask = mod_mask;
#ifdef FEAT_MOUSE
old_mouse_row = mouse_row;
old_mouse_col = mouse_col;
#endif
}
/*
+5 -9
View File
@@ -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 win_T *au_pending_free_win INIT(= NULL);
#ifdef FEAT_MOUSE
/*
* 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_dragging INIT(= 0); // extending Visual area with
// 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
* automatic queries for the mouse position.
*/
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,
// so that gui_mouse_correct() is called afterwards, to correct the mouse
// 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
EXTERN linenr_T gui_prev_topline INIT(= 0);
# ifdef FEAT_DIFF
# ifdef FEAT_DIFF
EXTERN int gui_prev_topfill INIT(= 0);
# endif
# endif
#endif
# ifdef FEAT_MOUSESHAPE
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
# endif
#endif
#ifdef FEAT_DIFF
// 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 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
+2 -2
View File
@@ -5436,7 +5436,7 @@ gui_do_findrepl(
i = msg_scroll;
if (down)
{
(void)do_search(NULL, '/', ga.ga_data, 1L, searchflags, NULL, NULL);
(void)do_search(NULL, '/', ga.ga_data, 1L, searchflags, NULL);
}
else
{
@@ -5444,7 +5444,7 @@ gui_do_findrepl(
* direction */
p = vim_strsave_escaped(ga.ga_data, (char_u *)"?");
if (p != NULL)
(void)do_search(NULL, '?', p, 1L, searchflags, NULL, NULL);
(void)do_search(NULL, '?', p, 1L, searchflags, NULL);
vim_free(p);
}
+2 -1
View File
@@ -1612,7 +1612,8 @@ luaV_print(lua_State *L)
lua_pop(L, 1);
}
luaL_pushresult(&b);
luaV_msg(L);
if (!got_int)
luaV_msg(L);
return 0;
}
+10 -5
View File
@@ -375,9 +375,13 @@ writer(writefn fn, char_u *str, PyInt n)
PythonIO_Flush();
old_fn = fn;
/* Write each NL separated line. Text after the last NL is kept for
* writing later. */
while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL)
// Write each NL separated line. Text after the last NL is kept for
// writing later.
// For normal messages: Do not output when "got_int" was set. This avoids
// a loop gone crazy flooding the terminal with messages. Also for when
// "q" is pressed at the more-prompt.
while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL
&& (fn == (writefn)emsg || !got_int))
{
PyInt len = ptr - str;
@@ -392,8 +396,9 @@ writer(writefn fn, char_u *str, PyInt n)
io_ga.ga_len = 0;
}
/* Put the remaining text into io_ga for later printing. */
if (n > 0 && ga_grow(&io_ga, (int)(n + 1)) == OK)
// Put the remaining text into io_ga for later printing.
if (n > 0 && (fn == (writefn)emsg || !got_int)
&& ga_grow(&io_ga, (int)(n + 1)) == OK)
{
mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)n);
io_ga.ga_len += (int)n;
+1 -1
View File
@@ -2886,7 +2886,7 @@ ins_compl_get_exp(pos_T *ini)
found_new_match = searchit(NULL, ins_buf, pos, NULL,
compl_direction,
compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG,
RE_LAST, (linenr_T)0, NULL, NULL);
RE_LAST, NULL);
--msg_silent;
if (!compl_started || set_match_pos)
{
+2 -2
View File
@@ -804,9 +804,9 @@ ml_open_file(buf_T *buf)
}
}
if (mfp->mf_fname == NULL) /* Failed! */
if (*p_dir != NUL && mfp->mf_fname == NULL)
{
need_wait_return = TRUE; /* call wait_return later */
need_wait_return = TRUE; // call wait_return later
++no_wait_return;
(void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
+2 -7
View File
@@ -1200,7 +1200,6 @@ wait_return(int redraw)
#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
@@ -1214,24 +1213,20 @@ wait_return(int redraw)
|| c == K_RIGHTMOUSE
|| c == K_X1MOUSE
|| c == K_X2MOUSE))
# ifdef FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
|| c == K_SWIPELEFT || c == K_SWIPERIGHT
|| c == K_SWIPEUP || c == K_SWIPEDOWN
|| c == K_FORCECLICK
# endif
#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)
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. */
-4
View File
@@ -847,9 +847,7 @@ get_keystroke(void)
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
@@ -936,14 +934,12 @@ get_number(
}
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(':');
+13 -41
View File
@@ -13,8 +13,6 @@
#include "vim.h"
#if defined(FEAT_MOUSE) || defined(PROTO)
/*
* Get class of a character for selection: same class means same word.
* 0: blank
@@ -1278,20 +1276,17 @@ get_pseudo_mouse_code(
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
# 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
@@ -1302,7 +1297,6 @@ set_mouse_termcode(
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;
@@ -1339,12 +1333,9 @@ set_mouse_termcode(
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)
# if defined(UNIX) || defined(VMS) || defined(PROTO)
void
del_mouse_termcode(
int n) // KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE
@@ -1354,7 +1345,6 @@ del_mouse_termcode(
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;
@@ -1391,7 +1381,6 @@ del_mouse_termcode(
has_mouse_termcode &= ~HMT_SGR_REL;
else
has_mouse_termcode &= ~HMT_NORMAL;
# endif
}
# endif
@@ -1401,15 +1390,13 @@ del_mouse_termcode(
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
// Should be outside proc, but may break MOUSESHAPE
# ifdef FEAT_GUI
// In the GUI the mouse is always enabled.
if (gui.in_use)
@@ -1443,7 +1430,6 @@ setmouse(void)
mch_setmouse(TRUE);
else
mch_setmouse(FALSE);
# endif
}
/*
@@ -2330,7 +2316,7 @@ check_termcode_mouse(
# endif
)
{
# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
# if defined(UNIX)
if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
// mouse-move event, using MOUSE_DRAG works
mouse_code = MOUSE_DRAG;
@@ -2355,7 +2341,7 @@ check_termcode_mouse(
}
# endif
# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
# if defined(UNIX)
else if (use_xterm_mouse() > 1)
{
if (mouse_code & MOUSE_DRAG_XTERM)
@@ -2851,10 +2837,8 @@ check_termcode_mouse(
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
@@ -3058,15 +3042,3 @@ vcol2col(win_T *wp, linenr_T lnum, int vcol)
return (int)(ptr - line);
}
#endif
#else // FEAT_MOUSE
/*
* Dummy implementation of setmouse() to avoid lots of #ifdefs.
*/
void
setmouse(void)
{
}
#endif // FEAT_MOUSE
+4 -24
View File
@@ -216,9 +216,7 @@ update_topline(void)
int check_topline = FALSE;
int check_botline = FALSE;
long *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
#ifdef FEAT_MOUSE
int save_so = *so_ptr;
#endif
/* If there is no valid screen and when the window height is zero just use
* the cursor line. */
@@ -235,11 +233,9 @@ update_topline(void)
if (curwin->w_valid & VALID_TOPLINE)
return;
#ifdef FEAT_MOUSE
/* When dragging with the mouse, don't scroll that quickly */
if (mouse_dragging > 0)
*so_ptr = mouse_dragging - 1;
#endif
old_topline = curwin->w_topline;
#ifdef FEAT_DIFF
@@ -444,9 +440,7 @@ update_topline(void)
validate_cursor();
}
#ifdef FEAT_MOUSE
*so_ptr = save_so;
#endif
}
/*
@@ -1780,10 +1774,8 @@ scroll_cursor_top(int min_scroll, int always)
linenr_T new_topline;
int off = get_scrolloff_value();
#ifdef FEAT_MOUSE
if (mouse_dragging > 0)
off = mouse_dragging - 1;
#endif
/*
* Decrease topline until:
@@ -2033,11 +2025,7 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
/* Stop when scrolled nothing or at least "min_scroll", found "extra"
* context for 'scrolloff' and counted all lines below the window. */
if ((((scrolled <= 0 || scrolled >= min_scroll)
&& extra >= (
#ifdef FEAT_MOUSE
mouse_dragging > 0 ? mouse_dragging - 1 :
#endif
so))
&& extra >= (mouse_dragging > 0 ? mouse_dragging - 1 : so))
|| boff.lnum + 1 > curbuf->b_ml.ml_line_count)
&& loff.lnum <= curwin->w_botline
#ifdef FEAT_DIFF
@@ -2079,11 +2067,8 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
used += boff.height;
if (used > curwin->w_height)
break;
if (extra < (
#ifdef FEAT_MOUSE
mouse_dragging > 0 ? mouse_dragging - 1 :
#endif
so) || scrolled < min_scroll)
if (extra < ( mouse_dragging > 0 ? mouse_dragging - 1 : so)
|| scrolled < min_scroll)
{
extra += boff.height;
if (boff.lnum >= curwin->w_botline
@@ -2259,13 +2244,11 @@ cursor_correct(void)
*/
above_wanted = so;
below_wanted = so;
#ifdef FEAT_MOUSE
if (mouse_dragging > 0)
{
above_wanted = mouse_dragging - 1;
below_wanted = mouse_dragging - 1;
}
#endif
if (curwin->w_topline == 1)
{
above_wanted = 0;
@@ -2275,10 +2258,7 @@ cursor_correct(void)
}
validate_botline();
if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1
#ifdef FEAT_MOUSE
&& mouse_dragging == 0
#endif
)
&& mouse_dragging == 0)
{
below_wanted = 0;
max_off = (curwin->w_height - 1) / 2;
+18 -24
View File
@@ -65,7 +65,7 @@ static void nv_end(cmdarg_T *cap);
static void nv_dollar(cmdarg_T *cap);
static void nv_search(cmdarg_T *cap);
static void nv_next(cmdarg_T *cap);
static int normal_search(cmdarg_T *cap, int dir, char_u *pat, int opt);
static int normal_search(cmdarg_T *cap, int dir, char_u *pat, int opt, int *wrapped);
static void nv_csearch(cmdarg_T *cap);
static void nv_brackets(cmdarg_T *cap);
static void nv_percent(cmdarg_T *cap);
@@ -303,7 +303,6 @@ static const struct nv_cmd
/* 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},
@@ -326,7 +325,6 @@ static const struct nv_cmd
{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},
@@ -1319,10 +1317,8 @@ end_visual_mode(void)
#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;
@@ -1849,14 +1845,13 @@ add_to_showcmd(int c)
int old_len;
int extra_len;
int overflow;
#if defined(FEAT_MOUSE)
int i;
static int ignore[] =
{
# ifdef FEAT_GUI
#ifdef FEAT_GUI
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
# endif
#endif
K_IGNORE, K_PS,
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE, K_MOUSEMOVE,
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
@@ -1869,7 +1864,6 @@ add_to_showcmd(int c)
# endif
0
};
#endif
if (!p_sc || msg_silent != 0)
return FALSE;
@@ -1880,13 +1874,11 @@ add_to_showcmd(int c)
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 == ' ')
@@ -2357,7 +2349,7 @@ find_decl(
for (;;)
{
t = searchit(curwin, curbuf, &curwin->w_cursor, NULL, FORWARD,
pat, 1L, searchflags, RE_LAST, (linenr_T)0, NULL, NULL);
pat, 1L, searchflags, RE_LAST, NULL);
if (curwin->w_cursor.lnum >= old_pos.lnum)
t = FAIL; /* match after start is failure too */
@@ -3750,7 +3742,7 @@ nv_ident(cmdarg_T *cap)
init_history();
add_to_history(HIST_SEARCH, buf, TRUE, NUL);
(void)normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0);
(void)normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0, NULL);
}
else
{
@@ -4277,7 +4269,7 @@ nv_search(cmdarg_T *cap)
(void)normal_search(cap, cap->cmdchar, cap->searchbuf,
(cap->arg || !EQUAL_POS(save_cursor, curwin->w_cursor))
? 0 : SEARCH_MARK);
? 0 : SEARCH_MARK, NULL);
}
/*
@@ -4287,16 +4279,17 @@ nv_search(cmdarg_T *cap)
static void
nv_next(cmdarg_T *cap)
{
pos_T old = curwin->w_cursor;
int i = normal_search(cap, 0, NULL, SEARCH_MARK | cap->arg);
pos_T old = curwin->w_cursor;
int wrapped = FALSE;
int i = normal_search(cap, 0, NULL, SEARCH_MARK | cap->arg, &wrapped);
if (i == 1 && EQUAL_POS(old, curwin->w_cursor))
if (i == 1 && !wrapped && EQUAL_POS(old, curwin->w_cursor))
{
/* Avoid getting stuck on the current cursor position, which can
* happen when an offset is given and the cursor is on the last char
* in the buffer: Repeat with count + 1. */
cap->count1 += 1;
(void)normal_search(cap, 0, NULL, SEARCH_MARK | cap->arg);
(void)normal_search(cap, 0, NULL, SEARCH_MARK | cap->arg, NULL);
cap->count1 -= 1;
}
}
@@ -4311,17 +4304,22 @@ normal_search(
cmdarg_T *cap,
int dir,
char_u *pat,
int opt) /* extra flags for do_search() */
int opt, // extra flags for do_search()
int *wrapped)
{
int i;
searchit_arg_T sia;
cap->oap->motion_type = MCHAR;
cap->oap->inclusive = FALSE;
cap->oap->use_reg_one = TRUE;
curwin->w_set_curswant = TRUE;
vim_memset(&sia, 0, sizeof(sia));
i = do_search(cap->oap, dir, pat, cap->count1,
opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG, NULL, NULL);
opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG, &sia);
if (wrapped != NULL)
*wrapped = sia.sa_wrapped;
if (i == 0)
clearop(cap->oap);
else
@@ -4637,7 +4635,6 @@ nv_brackets(cmdarg_T *cap)
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.
@@ -4648,7 +4645,6 @@ nv_brackets(cmdarg_T *cap)
(cap->cmdchar == ']') ? FORWARD : BACKWARD,
cap->count1, PUT_FIXINDENT);
}
#endif /* FEAT_MOUSE */
#ifdef FEAT_FOLDING
/*
@@ -6232,7 +6228,6 @@ nv_g_cmd(cmdarg_T *cap)
nv_gd(oap, cap->nchar, (int)cap->count0);
break;
#ifdef FEAT_MOUSE
/*
* g<*Mouse> : <C-*mouse>
*/
@@ -6255,7 +6250,6 @@ nv_g_cmd(cmdarg_T *cap)
mod_mask = MOD_MASK_CTRL;
(void)do_mouse(oap, cap->nchar, BACKWARD, cap->count1, 0);
break;
#endif
case K_IGNORE:
break;
-2
View File
@@ -4369,10 +4369,8 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
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
+100 -10
View File
@@ -5086,9 +5086,7 @@ clear_termoptions(void)
* 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
mch_setmouse(FALSE); // switch mouse off
#ifdef FEAT_TITLE
mch_restore_title(SAVE_RESTORE_BOTH); /* restore window titles */
#endif
@@ -5756,6 +5754,12 @@ copy_winopt(winopt_T *from, winopt_T *to)
#ifdef FEAT_SIGNS
to->wo_scl = vim_strsave(from->wo_scl);
#endif
#ifdef FEAT_EVAL
// Copy the script context so that we know where the value was last set.
mch_memmove(to->wo_script_ctx, from->wo_script_ctx,
sizeof(to->wo_script_ctx));
#endif
check_winopt(to); /* don't want NULL pointers */
}
@@ -5853,11 +5857,36 @@ clear_winopt(winopt_T *wop UNUSED)
#endif
}
#ifdef FEAT_EVAL
// Index into the options table for a buffer-local option enum.
static int buf_opt_idx[BV_COUNT];
# define COPY_OPT_SCTX(buf, bv) buf->b_p_script_ctx[bv] = options[buf_opt_idx[bv]].script_ctx
/*
* Initialize buf_opt_idx[] if not done already.
*/
static void
init_buf_opt_idx(void)
{
static int did_init_buf_opt_idx = FALSE;
int i;
if (did_init_buf_opt_idx)
return;
did_init_buf_opt_idx = TRUE;
for (i = 0; !istermoption_idx(i); i++)
if (options[i].indir & PV_BUF)
buf_opt_idx[options[i].indir & PV_MASK] = i;
}
#else
# define COPY_OPT_SCTX(buf, bv)
#endif
/*
* Copy global option values to local options for one buffer.
* Used when creating a new buffer and sometimes when entering a buffer.
* flags:
* BCO_ENTER We will enter the buf buffer.
* BCO_ENTER We will enter the buffer "buf".
* BCO_ALWAYS Always copy the options, but only set b_p_initialized when
* appropriate.
* BCO_NOHELP Don't copy the values to a help buffer.
@@ -5896,12 +5925,16 @@ buf_copy_options(buf_T *buf, int flags)
if (should_copy || (flags & BCO_ALWAYS))
{
/* Don't copy the options specific to a help buffer when
* BCO_NOHELP is given or the options were initialized already
* (jumping back to a help file with CTRL-T or CTRL-O) */
#ifdef FEAT_EVAL
vim_memset(buf->b_p_script_ctx, 0, sizeof(buf->b_p_script_ctx));
init_buf_opt_idx();
#endif
// Don't copy the options specific to a help buffer when
// BCO_NOHELP is given or the options were initialized already
// (jumping back to a help file with CTRL-T or CTRL-O)
dont_do_help = ((flags & BCO_NOHELP) && buf->b_help)
|| buf->b_p_initialized;
if (dont_do_help) /* don't free b_p_isk */
if (dont_do_help) // don't free b_p_isk
{
save_p_isk = buf->b_p_isk;
buf->b_p_isk = NULL;
@@ -5936,39 +5969,62 @@ buf_copy_options(buf_T *buf, int flags)
free_buf_options(buf, FALSE);
buf->b_p_ai = p_ai;
COPY_OPT_SCTX(buf, BV_AI);
buf->b_p_ai_nopaste = p_ai_nopaste;
buf->b_p_sw = p_sw;
COPY_OPT_SCTX(buf, BV_SW);
buf->b_p_tw = p_tw;
COPY_OPT_SCTX(buf, BV_TW);
buf->b_p_tw_nopaste = p_tw_nopaste;
buf->b_p_tw_nobin = p_tw_nobin;
buf->b_p_wm = p_wm;
COPY_OPT_SCTX(buf, BV_WM);
buf->b_p_wm_nopaste = p_wm_nopaste;
buf->b_p_wm_nobin = p_wm_nobin;
buf->b_p_bin = p_bin;
COPY_OPT_SCTX(buf, BV_BIN);
buf->b_p_bomb = p_bomb;
COPY_OPT_SCTX(buf, BV_BOMB);
buf->b_p_fixeol = p_fixeol;
COPY_OPT_SCTX(buf, BV_FIXEOL);
buf->b_p_et = p_et;
COPY_OPT_SCTX(buf, BV_ET);
buf->b_p_et_nobin = p_et_nobin;
buf->b_p_et_nopaste = p_et_nopaste;
buf->b_p_ml = p_ml;
COPY_OPT_SCTX(buf, BV_ML);
buf->b_p_ml_nobin = p_ml_nobin;
buf->b_p_inf = p_inf;
buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
COPY_OPT_SCTX(buf, BV_INF);
if (cmdmod.noswapfile)
buf->b_p_swf = FALSE;
else
{
buf->b_p_swf = p_swf;
COPY_OPT_SCTX(buf, BV_INF);
}
buf->b_p_cpt = vim_strsave(p_cpt);
COPY_OPT_SCTX(buf, BV_CPT);
#ifdef BACKSLASH_IN_FILENAME
buf->b_p_csl = vim_strsave(p_csl);
COPY_OPT_SCTX(buf, BV_CSL);
#endif
#ifdef FEAT_COMPL_FUNC
buf->b_p_cfu = vim_strsave(p_cfu);
COPY_OPT_SCTX(buf, BV_CFU);
buf->b_p_ofu = vim_strsave(p_ofu);
COPY_OPT_SCTX(buf, BV_OFU);
#endif
#ifdef FEAT_EVAL
buf->b_p_tfu = vim_strsave(p_tfu);
COPY_OPT_SCTX(buf, BV_TFU);
#endif
buf->b_p_sts = p_sts;
COPY_OPT_SCTX(buf, BV_STS);
buf->b_p_sts_nopaste = p_sts_nopaste;
#ifdef FEAT_VARTABS
buf->b_p_vsts = vim_strsave(p_vsts);
COPY_OPT_SCTX(buf, BV_VSTS);
if (p_vsts && p_vsts != empty_option)
tabstop_set(p_vsts, &buf->b_p_vsts_array);
else
@@ -5977,66 +6033,92 @@ buf_copy_options(buf_T *buf, int flags)
? vim_strsave(p_vsts_nopaste) : NULL;
#endif
buf->b_p_sn = p_sn;
COPY_OPT_SCTX(buf, BV_SN);
buf->b_p_com = vim_strsave(p_com);
COPY_OPT_SCTX(buf, BV_COM);
#ifdef FEAT_FOLDING
buf->b_p_cms = vim_strsave(p_cms);
COPY_OPT_SCTX(buf, BV_CMS);
#endif
buf->b_p_fo = vim_strsave(p_fo);
COPY_OPT_SCTX(buf, BV_FO);
buf->b_p_flp = vim_strsave(p_flp);
COPY_OPT_SCTX(buf, BV_FLP);
// NOTE: Valgrind may report a bogus memory leak for 'nrformats'
// when it is set to 8 bytes in defaults.vim.
buf->b_p_nf = vim_strsave(p_nf);
COPY_OPT_SCTX(buf, BV_NF);
buf->b_p_mps = vim_strsave(p_mps);
COPY_OPT_SCTX(buf, BV_MPS);
#ifdef FEAT_SMARTINDENT
buf->b_p_si = p_si;
COPY_OPT_SCTX(buf, BV_SI);
#endif
buf->b_p_ci = p_ci;
COPY_OPT_SCTX(buf, BV_CI);
#ifdef FEAT_CINDENT
buf->b_p_cin = p_cin;
COPY_OPT_SCTX(buf, BV_CIN);
buf->b_p_cink = vim_strsave(p_cink);
COPY_OPT_SCTX(buf, BV_CINK);
buf->b_p_cino = vim_strsave(p_cino);
COPY_OPT_SCTX(buf, BV_CINO);
#endif
/* Don't copy 'filetype', it must be detected */
// Don't copy 'filetype', it must be detected
buf->b_p_ft = empty_option;
buf->b_p_pi = p_pi;
COPY_OPT_SCTX(buf, BV_PI);
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
buf->b_p_cinw = vim_strsave(p_cinw);
COPY_OPT_SCTX(buf, BV_CINW);
#endif
#ifdef FEAT_LISP
buf->b_p_lisp = p_lisp;
COPY_OPT_SCTX(buf, BV_LISP);
#endif
#ifdef FEAT_SYN_HL
/* Don't copy 'syntax', it must be set */
buf->b_p_syn = empty_option;
buf->b_p_smc = p_smc;
COPY_OPT_SCTX(buf, BV_SMC);
buf->b_s.b_syn_isk = empty_option;
#endif
#ifdef FEAT_SPELL
buf->b_s.b_p_spc = vim_strsave(p_spc);
COPY_OPT_SCTX(buf, BV_SPC);
(void)compile_cap_prog(&buf->b_s);
buf->b_s.b_p_spf = vim_strsave(p_spf);
COPY_OPT_SCTX(buf, BV_SPF);
buf->b_s.b_p_spl = vim_strsave(p_spl);
COPY_OPT_SCTX(buf, BV_SPL);
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
buf->b_p_inde = vim_strsave(p_inde);
COPY_OPT_SCTX(buf, BV_INDE);
buf->b_p_indk = vim_strsave(p_indk);
COPY_OPT_SCTX(buf, BV_INDK);
#endif
buf->b_p_fp = empty_option;
#if defined(FEAT_EVAL)
buf->b_p_fex = vim_strsave(p_fex);
COPY_OPT_SCTX(buf, BV_FEX);
#endif
#ifdef FEAT_CRYPT
buf->b_p_key = vim_strsave(p_key);
COPY_OPT_SCTX(buf, BV_KEY);
#endif
#ifdef FEAT_SEARCHPATH
buf->b_p_sua = vim_strsave(p_sua);
COPY_OPT_SCTX(buf, BV_SUA);
#endif
#ifdef FEAT_KEYMAP
buf->b_p_keymap = vim_strsave(p_keymap);
COPY_OPT_SCTX(buf, BV_KMAP);
buf->b_kmap_state |= KEYMAP_INIT;
#endif
#ifdef FEAT_TERMINAL
buf->b_p_twsl = p_twsl;
COPY_OPT_SCTX(buf, BV_TWSL);
#endif
#ifdef FEAT_GUI_MACVIM
buf->b_p_mmta = p_mmta;
@@ -6044,7 +6126,9 @@ buf_copy_options(buf_T *buf, int flags)
/* This isn't really an option, but copying the langmap and IME
* state from the current buffer is better than resetting it. */
buf->b_p_iminsert = p_iminsert;
COPY_OPT_SCTX(buf, BV_IMI);
buf->b_p_imsearch = p_imsearch;
COPY_OPT_SCTX(buf, BV_IMS);
/* options that are normally global but also have a local value
* are not copied, start using the global value */
@@ -6068,12 +6152,14 @@ buf_copy_options(buf_T *buf, int flags)
buf->b_p_inc = empty_option;
# ifdef FEAT_EVAL
buf->b_p_inex = vim_strsave(p_inex);
COPY_OPT_SCTX(buf, BV_INEX);
# endif
#endif
buf->b_p_dict = empty_option;
buf->b_p_tsr = empty_option;
#ifdef FEAT_TEXTOBJ
buf->b_p_qe = vim_strsave(p_qe);
COPY_OPT_SCTX(buf, BV_QE);
#endif
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
buf->b_p_bexpr = empty_option;
@@ -6083,6 +6169,7 @@ buf_copy_options(buf_T *buf, int flags)
#endif
#ifdef FEAT_PERSISTENT_UNDO
buf->b_p_udf = p_udf;
COPY_OPT_SCTX(buf, BV_UDF);
#endif
#ifdef FEAT_LISP
buf->b_p_lw = empty_option;
@@ -6108,10 +6195,12 @@ buf_copy_options(buf_T *buf, int flags)
else
{
buf->b_p_isk = vim_strsave(p_isk);
COPY_OPT_SCTX(buf, BV_ISK);
did_isk = TRUE;
buf->b_p_ts = p_ts;
#ifdef FEAT_VARTABS
buf->b_p_vts = vim_strsave(p_vts);
COPY_OPT_SCTX(buf, BV_VTS);
if (p_vts && p_vts != empty_option && !buf->b_p_vts_array)
tabstop_set(p_vts, &buf->b_p_vts_array);
else
@@ -6121,6 +6210,7 @@ buf_copy_options(buf_T *buf, int flags)
if (buf->b_p_bt[0] == 'h')
clear_string_option(&buf->b_p_bt);
buf->b_p_ma = p_ma;
COPY_OPT_SCTX(buf, BV_MA);
}
}
+1 -1
View File
@@ -1005,7 +1005,7 @@ EXTERN unsigned tbis_flags;
# define TBIS_GIANT 0x20
#endif
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 unsigned ttym_flags;
# define TTYM_XTERM 0x01
+1 -1
View File
@@ -2735,7 +2735,7 @@ static struct vimoption options[] =
(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))
#if defined(UNIX) || defined(VMS)
(char_u *)&p_ttym, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
+5 -14
View File
@@ -47,7 +47,7 @@ static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL}
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)
static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL};
#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};
#endif
static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL};
@@ -76,7 +76,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
NULL};
static char *(p_fcl_values[]) = {"all", NULL};
#endif
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "noinsert", "noselect", NULL};
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", NULL};
#ifdef BACKSLASH_IN_FILENAME
static char *(p_csl_values[]) = {"slash", "backslash", NULL};
#endif
@@ -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_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))
#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)
@@ -1592,7 +1592,7 @@ did_set_string_option(
}
#endif
#if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
#if defined(UNIX) || defined(VMS)
// 'ttymouse'
else if (varp == &p_ttym)
{
@@ -2268,12 +2268,7 @@ did_set_string_option(
#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'
@@ -2403,20 +2398,16 @@ did_set_string_option(
#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)
&& (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0)
curwin->w_set_curswant = TRUE;
#ifdef FEAT_GUI
+25 -29
View File
@@ -2284,7 +2284,6 @@ use_xterm_like_mouse(char_u *name)
}
#endif
#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
/*
* Return non-zero when using an xterm mouse, according to 'ttymouse'.
* Return 1 for "xterm".
@@ -2305,7 +2304,6 @@ use_xterm_mouse(void)
return 1;
return 0;
}
#endif
int
vim_is_iris(char_u *name)
@@ -3598,7 +3596,6 @@ get_tty_info(int fd, ttyinfo_T *info)
#endif /* VMS */
#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
static int mouse_ison = FALSE;
/*
@@ -3607,29 +3604,29 @@ static int mouse_ison = FALSE;
void
mch_setmouse(int on)
{
# ifdef FEAT_BEVAL_TERM
#ifdef FEAT_BEVAL_TERM
static int bevalterm_ison = FALSE;
# endif
#endif
int xterm_mouse_vers;
# if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
#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
#endif
if (on == mouse_ison
# ifdef FEAT_BEVAL_TERM
#ifdef FEAT_BEVAL_TERM
&& p_bevalterm == bevalterm_ison
# endif
#endif
)
/* return quickly if nothing to do */
return;
xterm_mouse_vers = use_xterm_mouse();
# ifdef FEAT_MOUSE_URXVT
#ifdef FEAT_MOUSE_URXVT
if (ttym_flags == TTYM_URXVT)
{
out_str_nf((char_u *)
@@ -3638,7 +3635,7 @@ mch_setmouse(int on)
: IF_EB("\033[?1015l", ESC_STR "[?1015l")));
mouse_ison = on;
}
# endif
#endif
if (ttym_flags == TTYM_SGR)
{
@@ -3650,7 +3647,7 @@ mch_setmouse(int on)
mouse_ison = on;
}
# ifdef FEAT_BEVAL_TERM
#ifdef FEAT_BEVAL_TERM
if (bevalterm_ison != (p_bevalterm && on))
{
bevalterm_ison = (p_bevalterm && on);
@@ -3659,7 +3656,7 @@ mch_setmouse(int on)
out_str_nf((char_u *)
(IF_EB("\033[?1003l", ESC_STR "[?1003l")));
}
# endif
#endif
if (xterm_mouse_vers > 0)
{
@@ -3667,10 +3664,10 @@ mch_setmouse(int on)
out_str_nf((char_u *)
(xterm_mouse_vers > 1
? (
# ifdef FEAT_BEVAL_TERM
#ifdef FEAT_BEVAL_TERM
bevalterm_ison
? IF_EB("\033[?1003h", ESC_STR "[?1003h") :
# endif
#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 */
@@ -3681,7 +3678,7 @@ mch_setmouse(int on)
mouse_ison = on;
}
# ifdef FEAT_MOUSE_DEC
#ifdef FEAT_MOUSE_DEC
else if (ttym_flags == TTYM_DEC)
{
if (on) /* enable mouse events */
@@ -3690,9 +3687,9 @@ mch_setmouse(int on)
out_str_nf((char_u *)"\033['z");
mouse_ison = on;
}
# endif
#endif
# ifdef FEAT_MOUSE_GPM
#ifdef FEAT_MOUSE_GPM
else
{
if (on)
@@ -3706,9 +3703,9 @@ mch_setmouse(int on)
mouse_ison = FALSE;
}
}
# endif
#endif
# ifdef FEAT_SYSMOUSE
#ifdef FEAT_SYSMOUSE
else
{
if (on)
@@ -3722,9 +3719,9 @@ mch_setmouse(int on)
mouse_ison = FALSE;
}
}
# endif
#endif
# ifdef FEAT_MOUSE_JSB
#ifdef FEAT_MOUSE_JSB
else
{
if (on)
@@ -3744,14 +3741,14 @@ mch_setmouse(int on)
* 4 = Windows Cross Hair
* 5 = Windows UP Arrow
*/
# ifdef JSBTERM_MOUSE_NONADVANCED
# 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
# else
out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\",
ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\"));
# endif
# endif
mouse_ison = TRUE;
}
else
@@ -3761,8 +3758,8 @@ mch_setmouse(int on)
mouse_ison = FALSE;
}
}
# endif
# ifdef FEAT_MOUSE_PTERM
#endif
#ifdef FEAT_MOUSE_PTERM
else
{
/* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */
@@ -3772,7 +3769,7 @@ mch_setmouse(int on)
out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h");
mouse_ison = on;
}
# endif
#endif
}
#if defined(FEAT_BEVAL_TERM) || defined(PROTO)
@@ -3935,7 +3932,6 @@ check_mouse_termcode(void)
del_mouse_termcode(KS_SGR_MOUSE_RELEASE);
}
}
#endif
/*
* set screen mode, always fails.
+18 -40
View File
@@ -1127,17 +1127,15 @@ decode_key_event(
#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)
#if defined(FEAT_GUI_MSWIN) && !defined(VIMDLL)
void
mch_setmouse(int on UNUSED)
{
}
# else
#else
static int g_fMouseAvail = FALSE; /* mouse present */
static int g_fMouseActive = FALSE; /* mouse enabled */
static int g_nMouseClick = -1; /* mouse status */
@@ -1152,10 +1150,10 @@ mch_setmouse(int on)
{
DWORD cmodein;
# ifdef VIMDLL
# ifdef VIMDLL
if (gui.in_use)
return;
# endif
# endif
if (!g_fMouseAvail)
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.
*/
@@ -1180,7 +1178,7 @@ mch_bevalterm_changed(void)
{
mch_setmouse(g_fMouseActive);
}
#endif
# endif
/*
* 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_yOldMouse = -1;
static linenr_T s_old_topline = 0;
#ifdef FEAT_DIFF
# ifdef FEAT_DIFF
static int s_old_topfill = 0;
#endif
# endif
static int s_cClicks = 1;
static BOOL s_fReleased = TRUE;
static DWORD s_dwLastClickTime = 0;
@@ -1275,12 +1273,12 @@ decode_mouse_event(
/* If the last thing returned was MOUSE_RELEASE, ignore this */
if (s_fReleased)
{
#ifdef FEAT_BEVAL_TERM
# ifdef FEAT_BEVAL_TERM
/* do return mouse move events when we want them */
if (p_bevalterm)
nButton = MOUSE_DRAG;
else
#endif
# endif
return FALSE;
}
@@ -1386,9 +1384,9 @@ decode_mouse_event(
|| s_yOldMouse != g_yMouse
|| s_nOldButton != nButton
|| s_old_topline != curwin->w_topline
#ifdef FEAT_DIFF
# ifdef FEAT_DIFF
|| s_old_topfill != curwin->w_topfill
#endif
# endif
|| (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset)
{
s_cClicks = 1;
@@ -1439,16 +1437,15 @@ decode_mouse_event(
s_xOldMouse = g_xMouse;
s_yOldMouse = g_yMouse;
s_old_topline = curwin->w_topline;
#ifdef FEAT_DIFF
# ifdef FEAT_DIFF
s_old_topfill = curwin->w_topfill;
#endif
# endif
s_nOldMouseClick = g_nMouseClick;
return TRUE;
}
# endif /* FEAT_GUI_MSWIN */
#endif /* FEAT_MOUSE */
#endif // FEAT_GUI_MSWIN
#ifdef MCH_CURSOR_SHAPE
@@ -1547,10 +1544,7 @@ WaitForChar(long msec, int ignore_input)
#endif
}
if (0
#ifdef FEAT_MOUSE
|| g_nMouseClick != -1
#endif
if (g_nMouseClick != -1
#ifdef FEAT_CLIENTSERVER
|| (!ignore_input && input_available())
#endif
@@ -1683,11 +1677,9 @@ WaitForChar(long msec, int ignore_input)
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;
@@ -1760,10 +1752,8 @@ tgetch(int *pmodifiers, WCHAR *pch2)
(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)
{
@@ -1783,13 +1773,11 @@ tgetch(int *pmodifiers, WCHAR *pch2)
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 */
@@ -1879,14 +1867,13 @@ mch_inchar(
typeaheadlen = 0;
break;
}
#ifdef FEAT_MOUSE
if (g_nMouseClick != -1)
{
# ifdef MCH_WRITE_DUMP
#ifdef MCH_WRITE_DUMP
if (fdDump)
fprintf(fdDump, "{%02x @ %d, %d}",
g_nMouseClick, g_xMouse, g_yMouse);
# endif
#endif
typeahead[typeaheadlen++] = ESC + 128;
typeahead[typeaheadlen++] = 'M';
typeahead[typeaheadlen++] = g_nMouseClick;
@@ -1895,7 +1882,6 @@ mch_inchar(
g_nMouseClick = -1;
}
else
#endif
{
WCHAR ch2 = NUL;
int modifiers = 0;
@@ -1918,9 +1904,7 @@ mch_inchar(
got_int = TRUE;
}
#ifdef FEAT_MOUSE
if (g_nMouseClick == -1)
#endif
{
int n = 1;
@@ -2675,9 +2659,7 @@ mch_init_c(void)
g_fWindInitCalled = TRUE;
#ifdef FEAT_MOUSE
g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT);
#endif
#ifdef FEAT_CLIPBOARD
win_clip_init();
@@ -3609,10 +3591,8 @@ mch_settmode(int tmode)
{
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
@@ -5501,12 +5481,10 @@ termcap_mode_start(void)
#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);
+1 -1
View File
@@ -62,7 +62,7 @@
#endif
#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 */
#endif
#if defined(__DATE__) && defined(__TIME__)
+34 -18
View File
@@ -622,33 +622,36 @@ pum_redraw(void)
}
#if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
static void
pum_position_info_popup(void)
/*
* Position the info popup relative to the popup menu item.
*/
void
pum_position_info_popup(win_T *wp)
{
int col = pum_col + pum_width + 1;
int row = pum_row;
int botpos = POPPOS_BOTLEFT;
curwin->w_popup_pos = POPPOS_TOPLEFT;
wp->w_popup_pos = POPPOS_TOPLEFT;
if (Columns - col < 20 && Columns - col < pum_col)
{
col = pum_col - 1;
curwin->w_popup_pos = POPPOS_TOPRIGHT;
wp->w_popup_pos = POPPOS_TOPRIGHT;
botpos = POPPOS_BOTRIGHT;
curwin->w_maxwidth = pum_col - 1;
wp->w_maxwidth = pum_col - 1;
}
else
curwin->w_maxwidth = Columns - col + 1;
curwin->w_maxwidth -= popup_extra_width(curwin);
wp->w_maxwidth = Columns - col + 1;
wp->w_maxwidth -= popup_extra_width(wp);
row -= popup_top_extra(curwin);
if (curwin->w_popup_flags & POPF_INFO_MENU)
row -= popup_top_extra(wp);
if (wp->w_popup_flags & POPF_INFO_MENU)
{
if (pum_row < pum_win_row)
{
// menu above cursor line, align with bottom
row += pum_height;
curwin->w_popup_pos = botpos;
wp->w_popup_pos = botpos;
}
else
// menu below cursor line, align with top
@@ -658,7 +661,7 @@ pum_position_info_popup(void)
// align with the selected item
row += pum_selected - pum_first + 1;
popup_set_wantpos_rowcol(curwin, row, col);
popup_set_wantpos_rowcol(wp, row, col);
}
#endif
@@ -756,15 +759,21 @@ pum_set_selected(int n, int repeat UNUSED)
tabpage_T *curtab_save = curtab;
int res = OK;
# ifdef FEAT_TEXT_PROP
int use_popup = strstr((char *)p_cot, "popup") != NULL;
use_popup_T use_popup;
# else
# define use_popup 0
# define use_popup POPUP_NONE
# endif
# ifdef FEAT_TEXT_PROP
has_info = TRUE;
if (strstr((char *)p_cot, "popuphidden") != NULL)
use_popup = USEPOPUP_HIDDEN;
else if (strstr((char *)p_cot, "popup") != NULL)
use_popup = USEPOPUP_NORMAL;
else
use_popup = USEPOPUP_NONE;
# endif
// Open a preview window. 3 lines by default. Prefer
// 'previewheight' if set and smaller.
// Open a preview window and set "curwin" to it.
// 3 lines by default, prefer 'previewheight' if set and smaller.
g_do_tagpreview = 3;
if (p_pvh > 0 && p_pvh < g_do_tagpreview)
g_do_tagpreview = p_pvh;
@@ -838,7 +847,7 @@ pum_set_selected(int n, int repeat UNUSED)
/* Increase the height of the preview window to show the
* text, but no more than 'previewheight' lines. */
if (repeat == 0 && !use_popup)
if (repeat == 0 && use_popup == USEPOPUP_NONE)
{
if (lnum > p_pvh)
lnum = p_pvh;
@@ -863,9 +872,9 @@ pum_set_selected(int n, int repeat UNUSED)
curwin->w_cursor.lnum = curwin->w_topline;
curwin->w_cursor.col = 0;
# ifdef FEAT_TEXT_PROP
if (use_popup)
if (use_popup != USEPOPUP_NONE)
{
pum_position_info_popup();
pum_position_info_popup(curwin);
if (win_valid(curwin_save))
redraw_win_later(curwin_save, SOME_VALID);
}
@@ -907,9 +916,16 @@ pum_set_selected(int n, int repeat UNUSED)
if (!resized && win_valid(curwin_save))
{
# ifdef FEAT_TEXT_PROP
win_T *wp = curwin;
# endif
++no_u_sync;
win_enter(curwin_save, TRUE);
--no_u_sync;
# ifdef FEAT_TEXT_PROP
if (use_popup == USEPOPUP_HIDDEN && win_valid(wp))
popup_hide(wp);
# endif
}
/* May need to update the screen again when there are
+25 -5
View File
@@ -493,12 +493,28 @@ handle_moved_argument(win_T *wp, dictitem_T *di, int mousemoved)
}
else if (di->di_tv.v_type == VAR_LIST
&& di->di_tv.vval.v_list != NULL
&& di->di_tv.vval.v_list->lv_len == 2)
&& (di->di_tv.vval.v_list->lv_len == 2
|| di->di_tv.vval.v_list->lv_len == 3))
{
list_T *l = di->di_tv.vval.v_list;
int mincol = tv_get_number(&l->lv_first->li_tv);
int maxcol = tv_get_number(&l->lv_first->li_next->li_tv);
list_T *l = di->di_tv.vval.v_list;
listitem_T *li = l->lv_first;
int mincol;
int maxcol;
if (di->di_tv.vval.v_list->lv_len == 3)
{
varnumber_T nr = tv_get_number(&l->lv_first->li_tv);
// Three numbers, might be from popup_getoptions().
if (mousemoved)
wp->w_popup_mouse_row = nr;
else
wp->w_popup_lnum = nr;
li = li->li_next;
}
mincol = tv_get_number(&li->li_tv);
maxcol = tv_get_number(&li->li_next->li_tv);
if (mousemoved)
{
wp->w_popup_mouse_mincol = mincol;
@@ -2225,7 +2241,7 @@ f_popup_close(typval_T *argvars, typval_T *rettv UNUSED)
popup_close_and_callback(wp, &argvars[1]);
}
static void
void
popup_hide(win_T *wp)
{
if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
@@ -2272,7 +2288,11 @@ f_popup_show(typval_T *argvars, typval_T *rettv UNUSED)
win_T *wp = find_popup_win(id);
if (wp != NULL)
{
popup_show(wp);
if (wp->w_popup_flags & POPF_INFO)
pum_position_info_popup(wp);
}
}
/*
+1 -1
View File
@@ -35,7 +35,7 @@ void global_exe(char_u *cmd);
char_u *get_old_sub(void);
void set_old_sub(char_u *val);
void free_old_sub(void);
int prepare_tagpreview(int undo_sync, int use_previewpopup, int use_popup);
int prepare_tagpreview(int undo_sync, int use_previewpopup, use_popup_T use_popup);
void ex_help(exarg_T *eap);
void ex_helpclose(exarg_T *eap);
char_u *check_help_lang(char_u *arg);
+4 -5
View File
@@ -15,13 +15,14 @@ char_u *skip_range(char_u *cmd, int *ctx);
void ex_ni(exarg_T *eap);
int expand_filename(exarg_T *eap, char_u **cmdlinep, char **errormsgp);
void separate_nextcmd(exarg_T *eap);
char_u *skip_cmd_arg( char_u *p, int rembs);
char_u *skip_cmd_arg(char_u *p, int rembs);
int get_bad_opt(char_u *p, exarg_T *eap);
int ends_excmd(int c);
char_u *find_nextcmd(char_u *p);
char_u *check_nextcmd(char_u *p);
char_u *get_command_name(expand_T *xp, int idx);
void not_exiting(void);
void ex_quit(exarg_T *eap);
void tabpage_close(int forceit);
void tabpage_close_other(tabpage_T *tp, int forceit);
void handle_drop(int filec, char_u **filev, int split, void (*callback)(void *), void *cookie);
@@ -31,8 +32,8 @@ void ex_splitview(exarg_T *eap);
void tabpage_new(void);
void do_exedit(exarg_T *eap, win_T *old_curwin);
void free_cd_dir(void);
void post_chdir(cdscope_T cdscope);
int changedir_func(char_u *new_dir, int forceit, cdscope_T cdscope);
void post_chdir(cdscope_T scope);
int changedir_func(char_u *new_dir, int forceit, cdscope_T scope);
void ex_cd(exarg_T *eap);
void do_sleep(long msec);
void ex_may_print(exarg_T *eap);
@@ -48,8 +49,6 @@ void exec_normal(int was_typed, int use_vpeekc, int may_use_terminal_loop);
int find_cmdline_var(char_u *src, int *usedlen);
char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char **errormsg, int *escaped);
char_u *expand_sfile(char_u *arg);
int put_eol(FILE *fd);
int put_line(FILE *fd, char *s);
void dialog_msg(char_u *buff, char *format, char_u *fname);
void set_no_hlsearch(int flag);
int is_loclist_cmd(int cmdidx);
+1
View File
@@ -3,6 +3,7 @@ void pum_display(pumitem_T *array, int size, int selected);
void pum_call_update_screen(void);
int pum_under_menu(int row, int col);
void pum_redraw(void);
void pum_position_info_popup(win_T *wp);
void pum_undisplay(void);
void pum_clear(void);
int pum_visible(void);
+1
View File
@@ -26,6 +26,7 @@ void f_popup_dialog(typval_T *argvars, typval_T *rettv);
void f_popup_menu(typval_T *argvars, typval_T *rettv);
void f_popup_notification(typval_T *argvars, typval_T *rettv);
void f_popup_close(typval_T *argvars, typval_T *rettv);
void popup_hide(win_T *wp);
void f_popup_hide(typval_T *argvars, typval_T *rettv);
void popup_show(win_T *wp);
void f_popup_show(typval_T *argvars, typval_T *rettv);
+3 -3
View File
@@ -22,9 +22,9 @@ char_u *last_search_pat(void);
void reset_search_dir(void);
void set_last_search_pat(char_u *s, int idx, int magic, int setlast);
void last_pat_prog(regmmatch_T *regmatch);
int searchit(win_T *win, buf_T *buf, pos_T *pos, pos_T *end_pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum, proftime_T *tm, int *timed_out);
int searchit(win_T *win, buf_T *buf, pos_T *pos, pos_T *end_pos, int dir, char_u *pat, long count, int options, int pat_use, searchit_arg_T *extra_arg);
void set_search_direction(int cdir);
int do_search(oparg_T *oap, int dirc, char_u *pat, long count, int options, proftime_T *tm, int *timed_out);
int do_search(oparg_T *oap, int dirc, char_u *pat, long count, int options, searchit_arg_T *sia);
int search_for_exact_line(buf_T *buf, pos_T *pos, int dir, char_u *pat);
int searchc(cmdarg_T *cap, int t_cmd);
pos_T *findmatch(oparg_T *oap, int initc);
@@ -46,6 +46,6 @@ int current_quote(oparg_T *oap, long count, int include, int quotechar);
int current_search(long count, int forward);
int linewhite(linenr_T lnum);
void find_pattern_in_path(char_u *ptr, int dir, int len, int whole, int skip_comments, int type, long count, int action, linenr_T start_lnum, linenr_T end_lnum);
struct spat *get_spat(int idx);
spat_T *get_spat(int idx);
int get_spat_last_idx(void);
/* vim: set ft=c : */
+1 -2
View File
@@ -3207,8 +3207,7 @@ qf_jump_goto_line(
// Move the cursor to the first line in the buffer
save_cursor = curwin->w_cursor;
curwin->w_cursor.lnum = 0;
if (!do_search(NULL, '/', qf_pattern, (long)1,
SEARCH_KEEP, NULL, NULL))
if (!do_search(NULL, '/', qf_pattern, (long)1, SEARCH_KEEP, NULL))
curwin->w_cursor = save_cursor;
}
}
-2
View File
@@ -352,7 +352,6 @@ free_register(void *reg)
}
#endif
#if defined(FEAT_MOUSE) || defined(PROTO)
/*
* return TRUE if the current yank register has type MLINE
*/
@@ -366,7 +365,6 @@ yank_register_mline(int regname)
get_yank_register(regname, FALSE);
return (y_current->y_type == MLINE);
}
#endif
/*
* Start or stop recording into a yank register.
+30 -17
View File
@@ -604,8 +604,8 @@ last_pat_prog(regmmatch_T *regmatch)
*/
int
searchit(
win_T *win, /* window to search in; can be NULL for a
buffer without a window! */
win_T *win, // window to search in; can be NULL for a
// buffer without a window!
buf_T *buf,
pos_T *pos,
pos_T *end_pos, // set to end of the match, unless NULL
@@ -613,10 +613,8 @@ searchit(
char_u *pat,
long count,
int options,
int pat_use, /* which pattern to use when "pat" is empty */
linenr_T stop_lnum, /* stop after this line number when != 0 */
proftime_T *tm UNUSED, /* timeout limit or NULL */
int *timed_out UNUSED) /* set when timed out or NULL */
int pat_use, // which pattern to use when "pat" is empty
searchit_arg_T *extra_arg) // optional extra arguments, can be NULL
{
int found;
linenr_T lnum; /* no init to shut up Apollo cc */
@@ -639,6 +637,20 @@ searchit(
#ifdef FEAT_SEARCH_EXTRA
int break_loop = FALSE;
#endif
linenr_T stop_lnum = 0; // stop after this line number when != 0
#ifdef FEAT_RELTIME
proftime_T *tm = NULL; // timeout limit or NULL
int *timed_out = NULL; // set when timed out or NULL
#endif
if (extra_arg != NULL)
{
stop_lnum = extra_arg->sa_stop_lnum;
#ifdef FEAT_RELTIME
tm = extra_arg->sa_tm;
timed_out = &extra_arg->sa_timed_out;
#endif
}
if (search_regcomp(pat, RE_SEARCH, pat_use,
(options & (SEARCH_HIS + SEARCH_KEEP)), &regmatch) == FAIL)
@@ -1076,6 +1088,8 @@ searchit(
if (!shortmess(SHM_SEARCH) && (options & SEARCH_MSG))
give_warning((char_u *)_(dir == BACKWARD
? top_bot_msg : bot_top_msg), TRUE);
if (extra_arg != NULL)
extra_arg->sa_wrapped = TRUE;
}
if (got_int || called_emsg
#ifdef FEAT_RELTIME
@@ -1187,8 +1201,7 @@ do_search(
char_u *pat,
long count,
int options,
proftime_T *tm, /* timeout limit or NULL */
int *timed_out) /* flag set on timeout or NULL */
searchit_arg_T *sia) // optional arguments or NULL
{
pos_T pos; /* position of the last match */
char_u *searchstr;
@@ -1278,7 +1291,7 @@ do_search(
*/
for (;;)
{
int show_top_bot_msg = FALSE;
int show_top_bot_msg = FALSE;
searchstr = pat;
dircp = NULL;
@@ -1520,7 +1533,7 @@ do_search(
(SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS
+ SEARCH_MSG + SEARCH_START
+ ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF))),
RE_LAST, (linenr_T)0, tm, timed_out);
RE_LAST, sia);
if (dircp != NULL)
*dircp = dirc; // restore second '/' or '?' for normal_cmd()
@@ -4750,7 +4763,7 @@ current_search(
result = searchit(curwin, curbuf, &pos, &end_pos,
(dir ? FORWARD : BACKWARD),
spats[last_idx].pat, (long) (i ? count : 1),
SEARCH_KEEP | flags, RE_SEARCH, 0, NULL, NULL);
SEARCH_KEEP | flags, RE_SEARCH, NULL);
/* First search may fail, but then start searching from the
* beginning of the file (cursor might be on the search match)
@@ -4863,7 +4876,7 @@ is_one_char(char_u *pattern, int move, pos_T *cur, int direction)
}
if (searchit(curwin, curbuf, &pos, NULL, direction, pattern, 1,
SEARCH_KEEP + flag, RE_SEARCH, 0, NULL, NULL) != FAIL)
SEARCH_KEEP + flag, RE_SEARCH, NULL) != FAIL)
{
/* Zero-width pattern should match somewhere, then we can check if
* start and end are in the same position. */
@@ -4873,7 +4886,7 @@ is_one_char(char_u *pattern, int move, pos_T *cur, int direction)
regmatch.startpos[0].col++;
nmatched = vim_regexec_multi(&regmatch, curwin, curbuf,
pos.lnum, regmatch.startpos[0].col, NULL, NULL);
if (!nmatched)
if (nmatched != 0)
break;
} while (direction == FORWARD ? regmatch.startpos[0].col < pos.col
: regmatch.startpos[0].col > pos.col);
@@ -4883,8 +4896,9 @@ is_one_char(char_u *pattern, int move, pos_T *cur, int direction)
result = (nmatched != 0
&& regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
&& regmatch.startpos[0].col == regmatch.endpos[0].col);
/* one char width */
if (!result && inc(&pos) >= 0 && pos.col == regmatch.endpos[0].col)
// one char width
if (!result && nmatched != 0
&& inc(&pos) >= 0 && pos.col == regmatch.endpos[0].col)
result = TRUE;
}
}
@@ -4963,8 +4977,7 @@ search_stat(
profile_setlimit(20L, &start);
#endif
while (!got_int && searchit(curwin, curbuf, &lastpos, NULL,
FORWARD, NULL, 1, SEARCH_KEEP, RE_LAST,
(linenr_T)0, NULL, NULL) != FAIL)
FORWARD, NULL, 1, SEARCH_KEEP, RE_LAST, NULL) != FAIL)
{
#ifdef FEAT_RELTIME
// Stop after passing the time limit.
+1 -1
View File
@@ -2861,7 +2861,7 @@ ex_spellrepall(exarg_T *eap UNUSED)
curwin->w_cursor.lnum = 0;
while (!got_int)
{
if (do_search(NULL, '/', frompat, 1L, SEARCH_KEEP, NULL, NULL) == 0
if (do_search(NULL, '/', frompat, 1L, SEARCH_KEEP, NULL) == 0
|| u_save_cursor() == FAIL)
break;
+13
View File
@@ -3890,6 +3890,19 @@ typedef struct spat
soffset_T off;
} spat_T;
/*
* Optional extra arguments for searchit().
*/
typedef struct
{
linenr_T sa_stop_lnum; // stop after this line number when != 0
#ifdef FEAT_RELTIME
proftime_T *sa_tm; // timeout limit or NULL
int sa_timed_out; // set when timed out
#endif
int sa_wrapped; // search wrapped around
} searchit_arg_T;
#define WRITEBUFSIZE 8192 // size of normal write buffer
#define FIO_LATIN1 0x01 // convert Latin1
+4 -4
View File
@@ -3542,7 +3542,7 @@ jumpto_tag(
save_lnum = curwin->w_cursor.lnum;
curwin->w_cursor.lnum = 0; /* start search before first line */
if (do_search(NULL, pbuf[0], pbuf + 1, (long)1,
search_options, NULL, NULL))
search_options, NULL))
retval = OK;
else
{
@@ -3554,7 +3554,7 @@ jumpto_tag(
*/
p_ic = TRUE;
if (!do_search(NULL, pbuf[0], pbuf + 1, (long)1,
search_options, NULL, NULL))
search_options, NULL))
{
/*
* Failed to find pattern, take a guess: "^func ("
@@ -3565,13 +3565,13 @@ jumpto_tag(
*tagp.tagname_end = NUL;
sprintf((char *)pbuf, "^%s\\s\\*(", tagp.tagname);
if (!do_search(NULL, '/', pbuf, (long)1,
search_options, NULL, NULL))
search_options, NULL))
{
/* Guess again: "^char * \<func (" */
sprintf((char *)pbuf, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(",
tagp.tagname);
if (!do_search(NULL, '/', pbuf, (long)1,
search_options, NULL, NULL))
search_options, NULL))
found = 0;
}
*tagp.tagname_end = cc;
+39 -40
View File
@@ -912,6 +912,8 @@ static struct builtin_term builtin_termcaps[] =
{(int)KS_TE, IF_EB("\033[2J\033[?47l\0338",
ESC_STR "[2J" ESC_STR_nc "[?47l" ESC_STR_nc "8")},
# endif
{(int)KS_CTI, IF_EB("\033[>4;2m", ESC_STR_nc "[>4;2m")},
{(int)KS_CTE, IF_EB("\033[>4;m", ESC_STR_nc "[>4;m")},
{(int)KS_CIS, IF_EB("\033]1;", ESC_STR "]1;")},
{(int)KS_CIE, "\007"},
{(int)KS_TS, IF_EB("\033]2;", ESC_STR "]2;")},
@@ -1963,10 +1965,12 @@ set_termname(char_u *term)
#if defined(UNIX) || defined(VMS)
term_is_xterm = vim_is_xterm(term);
#endif
#ifdef FEAT_TERMRESPONSE
is_not_xterm = FALSE;
is_mac_terminal = FALSE;
#endif
#ifdef FEAT_MOUSE
# if defined(UNIX) || defined(VMS)
# ifdef FEAT_MOUSE_TTY
#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.
@@ -1974,7 +1978,7 @@ set_termname(char_u *term)
{
char_u *p = (char_u *)"";
# ifdef FEAT_MOUSE_XTERM
# ifdef FEAT_MOUSE_XTERM
if (use_xterm_like_mouse(term))
{
if (use_xterm_mouse())
@@ -1982,7 +1986,7 @@ set_termname(char_u *term)
else
p = (char_u *)"xterm";
}
# endif
# endif
if (p != NULL)
{
set_option_value((char_u *)"ttym", 0L, p, 0);
@@ -1991,17 +1995,15 @@ set_termname(char_u *term)
reset_option_was_set((char_u *)"ttym");
}
if (p == NULL
# ifdef FEAT_GUI
# ifdef FEAT_GUI
|| gui.in_use
# endif
# endif
)
check_mouse_termcode(); /* set mouse termcode anyway */
}
# endif
# else
#else
set_mouse_termcode(KS_MOUSE, (char_u *)"\233M");
# endif
#endif /* FEAT_MOUSE */
#endif
#ifdef USE_TERM_CONSOLE
/* DEFAULT_TERM indicates that it is the machine console. */
@@ -2567,8 +2569,6 @@ out_char_nf(unsigned c)
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.
@@ -2592,7 +2592,6 @@ out_str_nf(char_u *s)
if (p_wd)
out_flush();
}
#endif
/*
* A conditional-flushing out_str, mainly for visualbell.
@@ -3153,9 +3152,6 @@ get_long_from_buf(char_u *buf, long_u *val)
}
#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
@@ -3193,7 +3189,6 @@ get_bytes_from_buf(char_u *buf, char_u *bytes, int num_bytes)
}
return len;
}
#endif
/*
* Check if the new shell size is valid, correct it if it's too small or way
@@ -3438,10 +3433,8 @@ settmode(int tmode)
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)
@@ -4664,8 +4657,8 @@ not_enough:
if (tp[0] == CSI)
switch_to_8bit();
// rxvt sends its version number: "20703" is 2.7.3.
// Screen sends 40500.
// rxvt sends its version number: "20703" is 2.7.3.
// Ignore it for when the user has set 'term' to xterm,
// even though it's an rxvt.
if (version > 20000)
@@ -4676,6 +4669,7 @@ not_enough:
int need_flush = FALSE;
int is_iterm2 = FALSE;
int is_mintty = FALSE;
int is_screen = FALSE;
// mintty 2.9.5 sends 77;20905;0c.
// (77 is ASCII 'M' for mintty.)
@@ -4721,14 +4715,21 @@ not_enough:
is_not_xterm = TRUE;
}
// screen sends 83;40500;0 83 is 'S' in ASCII.
if (arg[0] == 83)
is_screen = TRUE;
// Only set 'ttymouse' automatically if it was not set
// by the user already.
if (!option_was_set((char_u *)"ttym"))
{
// Xterm version 277 supports SGR. Also support
// Terminal.app, iTerm2 and mintty.
if (version >= 277 || is_iterm2 || is_mac_terminal
|| is_mintty)
// Terminal.app, iTerm2, mintty, and screen 4.7+.
if ((!is_screen && version >= 277)
|| is_iterm2
|| is_mac_terminal
|| is_mintty
|| (is_screen && arg[1] >= 40700))
set_option_value((char_u *)"ttym", 0L,
(char_u *)"sgr", 0);
// if xterm version >= 95 use mouse dragging
@@ -5086,8 +5087,7 @@ not_enough:
/* 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
* so that we know which window to scroll later.
@@ -5111,29 +5111,29 @@ not_enough:
slen += num_bytes;
}
else
# endif
#endif
/*
* If it is a mouse click, get the coordinates.
*/
if (key_name[0] == KS_MOUSE
# ifdef FEAT_MOUSE_GPM
#ifdef FEAT_MOUSE_GPM
|| key_name[0] == KS_GPM_MOUSE
# endif
# ifdef FEAT_MOUSE_JSB
#endif
#ifdef FEAT_MOUSE_JSB
|| key_name[0] == KS_JSBTERM_MOUSE
# endif
# ifdef FEAT_MOUSE_NET
#endif
#ifdef FEAT_MOUSE_NET
|| key_name[0] == KS_NETTERM_MOUSE
# endif
# ifdef FEAT_MOUSE_DEC
#endif
#ifdef FEAT_MOUSE_DEC
|| key_name[0] == KS_DEC_MOUSE
# endif
# ifdef FEAT_MOUSE_PTERM
#endif
#ifdef FEAT_MOUSE_PTERM
|| key_name[0] == KS_PTERM_MOUSE
# endif
# ifdef FEAT_MOUSE_URXVT
#endif
#ifdef FEAT_MOUSE_URXVT
|| key_name[0] == KS_URXVT_MOUSE
# endif
#endif
|| key_name[0] == KS_SGR_MOUSE
|| key_name[0] == KS_SGR_MOUSE_RELEASE)
{
@@ -5141,7 +5141,6 @@ not_enough:
&modifiers) == -1)
return -1;
}
#endif /* FEAT_MOUSE */
#ifdef FEAT_GUI
/*
+10
View File
@@ -3078,6 +3078,16 @@ term_after_channel_closed(term_T *term)
aco_save_T aco;
int do_set_w_closing = term->tl_buffer->b_nwindows == 0;
// If this is the last normal window: exit Vim.
if (term->tl_buffer->b_nwindows > 0 && only_one_window())
{
exarg_T ea;
vim_memset(&ea, 0, sizeof(ea));
ex_quit(&ea);
return TRUE;
}
// ++close or term_finish == "close"
ch_log(NULL, "terminal job finished, closing window");
aucmd_prepbuf(&aco, term->tl_buffer);
+9 -2
View File
@@ -69,9 +69,14 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
$(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
report:
@echo ""
@rem without the +eval feature test_result.log is a copy of test.log
@if exist test.log ( copy /y test.log test_result.log > nul ) \
else ( echo No failures reported > test_result.log )
$(VIMPROG) -u NONE $(NO_INITS) -S summarize.vim messages
@echo.
@echo Test results:
@if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \
@type test_result.log
@if exist test.log ( echo TEST FAILURE & exit /b 1 ) \
else ( echo ALL DONE )
clean:
@@ -92,12 +97,14 @@ clean:
-for /d %i in (X*) do @rmdir /s/q %i
-if exist viminfo del viminfo
-if exist test.log del test.log
-if exist test_result.log del test_result.log
-if exist messages del messages
-if exist benchmark.out del benchmark.out
-if exist opt_test.vim del opt_test.vim
nolog:
-if exist test.log del test.log
-if exist test_result.log del test_result.log
-if exist messages del messages
benchmark:
+2 -2
View File
@@ -73,8 +73,8 @@ $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS_RES): $(SCRIPTS_FIRST)
# make test_largefile
$(NEW_TESTS):
rm -f $@.res test.log messages
$(MAKE) -f Makefile $@.res
cat messages
@MAKEFLAGS=--no-print-directory $(MAKE) -f Makefile $@.res
@cat messages
@if test -f test.log; then \
exit 1; \
fi
@@ -0,0 +1,14 @@
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|w|o|r|d> @43
|~+0#4040ff13&| @23| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@26
@@ -0,0 +1,14 @@
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|n|o|t|h|e|r|w|o|r|d> @37
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0&#e0e0e08|i|m@1|e|d|i|a|t|e| |i|n|f|o| |3| | +0#4040ff13#ffffff0@9
|~| @23| +0#0000001#e0e0e08|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |2| |o|f| |4| +0#0000000&@26
@@ -0,0 +1,14 @@
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|n|o|i|n|f|o> @42
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0&#e0e0e08|a|s|y|n|c| |i|n|f|o| |4| | +0#4040ff13#ffffff0@13
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#e0e0e08|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |3| |o|f| |4| +0#0000000&@26
+8
View File
@@ -0,0 +1,8 @@
>T+0&#ffffff0|h|i|s| |i|s| |s|o|m|e| |t|e|x|t| |w|i|t|h|o|u|t| |a|n|y| |s|p|e|l@1| |e|r@1|o|r|s|.| @1|E|v|e|r|y|t|h|i|n|g| @19
|s|h|o|u|l|d| |j|u|s|t| |b|e| |b|l|a|c|k|,| |n|o|t|h|i|n|g| |w|r|o|n|g| |h|e|r|e|.| @33
@75
|T|h|i|s| |l|i|n|e| |h|a|s| |a| |s+0&#ffd7d7255|e|p|l@1| +0&#ffffff0|e|r@1|o|r|.| |a+0&#5fd7ff255|n|d| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s|.| @28
|A+0&#ffd7d7255|n|d| |a|n|d| +0&#ffffff0|t|h|i|s| |i|s| |t+0&#ffd7d7255|h|e| |t|h|e| +0&#ffffff0|d|u|p|l|i|c|a|t|i|o|n|.| @38
|w+0&#5fd7ff255|i|t|h| +0&#ffffff0|m|i|s@1|i|n|g| |c|a|p|s| |h|e|r|e|.| @51
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|
+9 -9
View File
@@ -1,20 +1,20 @@
>/+0#0000e05#ffffff0|*| |c|o|m@1|e|n|t| |l|i|n|e| |a|t| |t|h|e| |t|o|p| |*|/| +0#0000000&@45
@2|i+0#00e0003&|n|t| +0#0000000&@69
|m|a|i|n|(|i+0#00e0003&|n|t| +0#0000000&|a|r|g|c|,| |c+0#00e0003&|h|a|r| +0#0000000&|*@1|a|r|g|v|)|/+0#0000e05&@1| |a|n|o|t|h|e|r| |c|o|m@1|e|n|t| +0#0000000&@29
|{| @73
|/+0#0000e05#ffffff0|*| |c|o|m@1|e|n|t| |l|i|n|e| |a|t| |t|h|e| |t|o|p| |*|/| +0#0000000&@45
|i+0#00e0003&|n|t| +0#0000000&|m|a|i|n|(|i+0#00e0003&|n|t| +0#0000000&|a|r|g|c|,| |c+0#00e0003&|h|a|r| +0#0000000&|*@1|a|r|g|v|)| |{| |/+0#0000e05&@1| |a|n|o|t|h|e|r| |c|o|m@1|e|n|t| +0#0000000&@22
|#+0#e000e06&|i|f| |0| +0#0000000&@69
| +0#0000e05&@2|i|n|t| @2|n|o|t|_|u|s|e|d|;| +0#0000000&@56
|#+0#e000e06&|e|l|s|e| +0#0000000&@69
@3|i+0#00e0003&|n|t| +0#0000000&@2|u|s|e|d|;| @60
|#+0#e000e06&|e|n|d|i|f| +0#0000000&@68
@3|p|r|i|n|t|f|(|"+0#e000002&|J|u|s|t| |a|n| |e|x|a|m|p|l|e| |p|i|e|c|e| |o|f| |C| |c|o|d|e|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @27
|#+0#e000e06&|e+0&#e0e0e08|n|d|i|f| +0#0000000&| +0&#ffffff0@67
| +0&#e0e0e08@2|p|r|i|n|t|f|(|"+0#e000002&|J|u|s|t| |a|n| |e|x|a|m|p|l|e| |p|i|e|c|e| |o|f| >C+0&#ffffff0| |c|o|d|e|\+0#e000e06&|n|"+0#e000002&|)+0#0000000&|;| @27
@3|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|0+0#e000002&|x|0|f@1|;+0#0000000&| @58
|}| @73
| +0#ffffff16#ff404010@16| +0#0000000#ffffff0@57
@3|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&@60
|m|y|F|u|n|c|t|i|o|n|(|c+0#00e0003&|o|n|s|t| +0#0000000&|d+0#00e0003&|o|u|b|l|e| +0#0000000&|c|o|u|n|t|,| |s+0#00e0003&|t|r|u|c|t| +0#0000000&|n|o|t|h|i|n|g|,| |l+0#00e0003&|o|n|g| +0#0000000&|t|h|e|r|e|)| |{| @14
@1| +0#0000e05&@6|/@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |r|e|a|d| |h|e|r|e| +0#0000000&@38
@1| +0#af5f00255&@6|f|o|r| +0#0000000&|(|i+0#00e0003&|n|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |<| |c|o|u|n|t|;| |+@1|i|)| |{| @33
@8|/+0#0000e05&@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |e+0&#ffff4012|n|d|i|f| +0&#ffffff0|h|e|r|e| +0#0000000&@37
@8|f+0#af5f00255&|o|r| +0#0000000&|(|i+0#00e0003&|n|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |<| |c|o|u|n|t|;| |+@1|i|)| |{| @33
@11|b+0#af5f00255&|r|e|a|k|;+0#0000000&| @57
@8|}| @65
@8|N+0&#ffff4012|o|t|e|:+0&#ffffff0| |a|s|d|f| @56
|}| @73
|"|X|t|e|s|t|.|c|"| |1|9|L|,| |3|6|1|C| @37|1|,|1| @10|A|l@1|
|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|8|,|3|7| @9|A|l@1|
Binary file not shown.
+22
View File
@@ -40,6 +40,7 @@ func Test_exiting()
endif
call delete('Xtestout')
" ExitPre autocommand splits the window, so that it's no longer the last one.
let after =<< trim [CODE]
au QuitPre * call writefile(["QuitPre"], "Xtestout", "a")
au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")
@@ -58,4 +59,25 @@ func Test_exiting()
\ readfile('Xtestout'))
endif
call delete('Xtestout')
" ExitPre autocommand splits and closes the window, so that there is still
" one window but it's a different one.
let after =<< trim [CODE]
au QuitPre * call writefile(["QuitPre"], "Xtestout", "a")
au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")
augroup nasty
au ExitPre * split | only
augroup END
quit
augroup nasty
au! ExitPre
augroup END
quit
[CODE]
if RunVim([], after, '')
call assert_equal(['QuitPre', 'ExitPre', 'QuitPre', 'ExitPre'],
\ readfile('Xtestout'))
endif
call delete('Xtestout')
endfunc
+3
View File
@@ -122,6 +122,7 @@ let s:filename_checks = {
\ 'cvs': ['cvs123'],
\ 'cvsrc': ['.cvsrc'],
\ 'cynpp': ['file.cyn'],
\ 'dart': ['file.dart', 'file.drt'],
\ 'datascript': ['file.ds'],
\ 'dcd': ['file.dcd'],
\ 'debcontrol': ['/debian/control'],
@@ -201,6 +202,7 @@ let s:filename_checks = {
\ 'hex': ['file.hex', 'file.h32'],
\ 'hgcommit': ['hg-editor-file.txt'],
\ 'hog': ['file.hog', 'snort.conf', 'vision.conf'],
\ 'hollywood': ['file.hws'],
\ 'hostconf': ['/etc/host.conf'],
\ 'hostsaccess': ['/etc/hosts.allow', '/etc/hosts.deny'],
\ 'template': ['file.tmpl'],
@@ -274,6 +276,7 @@ let s:filename_checks = {
\ 'mason': ['file.mason', 'file.mhtml', 'file.comp'],
\ 'master': ['file.mas', 'file.master'],
\ 'mel': ['file.mel'],
\ 'meson': ['meson.build', 'meson_options.txt'],
\ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user',
\ '/log/auth.log', '/log/cron.log', '/log/daemon.log', '/log/debug.log', '/log/kern.log', '/log/lpr.log', '/log/mail.log', '/log/messages.log', '/log/news/news.log', '/log/syslog.log', '/log/user.log',
\ '/log/auth.err', '/log/cron.err', '/log/daemon.err', '/log/debug.err', '/log/kern.err', '/log/lpr.err', '/log/mail.err', '/log/messages.err', '/log/news/news.err', '/log/syslog.err', '/log/user.err',
+32 -4
View File
@@ -296,20 +296,48 @@ func Test_set_errors()
call assert_fails('set t_foo=', 'E846:')
endfunc
func CheckWasSet(name)
let verb_cm = execute('verbose set ' .. a:name .. '?')
call assert_match('Last set from.*test_options.vim', verb_cm)
endfunc
func CheckWasNotSet(name)
let verb_cm = execute('verbose set ' .. a:name .. '?')
call assert_notmatch('Last set from', verb_cm)
endfunc
" Must be executed before other tests that set 'term'.
func Test_000_term_option_verbose()
CheckNotGui
let verb_cm = execute('verbose set t_cm')
call assert_notmatch('Last set from', verb_cm)
call CheckWasNotSet('t_cm')
let term_save = &term
set term=ansi
let verb_cm = execute('verbose set t_cm')
call assert_match('Last set from.*test_options.vim', verb_cm)
call CheckWasSet('t_cm')
let &term = term_save
endfunc
func Test_copy_context()
setlocal list
call CheckWasSet('list')
split
call CheckWasSet('list')
quit
setlocal nolist
set ai
call CheckWasSet('ai')
set filetype=perl
call CheckWasSet('filetype')
set fo=tcroq
call CheckWasSet('fo')
split Xsomebuf
call CheckWasSet('ai')
call CheckWasNotSet('filetype')
call CheckWasSet('fo')
endfunc
func Test_set_ttytype()
CheckUnix
CheckNotGui
+63
View File
@@ -170,6 +170,10 @@ func Test_popup_with_border_and_padding()
call assert_equal(['Top', 'Right', 'Bottom', 'Left'], options.borderhighlight)
call assert_equal(['1', '^', '2', '>', '3', 'v', '4', '<'], options.borderchars)
" Check that popup_setoptions() takes the output of popup_getoptions()
call popup_setoptions(winid, options)
call assert_equal(options, popup_getoptions(winid))
let winid = popup_create('hello both', #{line: 3, col: 8, border: [], padding: []})
call assert_equal(#{
\ line: 3,
@@ -2498,6 +2502,41 @@ func Get_popupmenu_lines()
let id = popup_findinfo()
eval id->popup_setoptions(#{highlight: 'InfoPopup'})
endfunc
func InfoHidden()
set completepopup=height:4,border:off,align:menu
set completeopt-=popup completeopt+=popuphidden
au CompleteChanged * call HandleChange()
endfunc
let s:counter = 0
func HandleChange()
let s:counter += 1
let selected = complete_info(['selected']).selected
if selected <= 0
" First time: do nothing, info remains hidden
return
endif
if selected == 1
" Second time: show info right away
let id = popup_findinfo()
if id
call popup_settext(id, 'immediate info ' .. s:counter)
call popup_show(id)
endif
else
" Third time: show info after a short delay
call timer_start(100, 'ShowInfo')
endif
endfunc
func ShowInfo(...)
let id = popup_findinfo()
if id
call popup_settext(id, 'async info ' .. s:counter)
call popup_show(id)
endif
endfunc
END
return lines
endfunc
@@ -2580,6 +2619,30 @@ func Test_popupmenu_info_align_menu()
call delete('XtestInfoPopupNb')
endfunc
func Test_popupmenu_info_hidden()
CheckScreendump
let lines = Get_popupmenu_lines()
call add(lines, 'call InfoHidden()')
call writefile(lines, 'XtestInfoPopupHidden')
let buf = RunVimInTerminal('-S XtestInfoPopupHidden', #{rows: 14})
call term_wait(buf, 50)
call term_sendkeys(buf, "A\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_1', {})
call term_sendkeys(buf, "\<C-N>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_2', {})
call term_sendkeys(buf, "\<C-N>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_3', {})
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
call delete('XtestInfoPopupHidden')
endfunc
func Test_popupwin_recycle_bnr()
let bufnr = popup_notification('nothing wrong', {})->winbufnr()
call popup_clear()
+6
View File
@@ -12,6 +12,12 @@ func Test_recover_root_dir()
set dir=/notexist/
endif
call assert_fails('split Xtest', 'E303:')
" No error with empty 'directory' setting.
set directory=
split XtestOK
close!
set dir&
endfunc
+25
View File
@@ -4,6 +4,8 @@
source check.vim
CheckFeature spell
source screendump.vim
func TearDown()
set nospell
call delete('Xtest.aff')
@@ -460,6 +462,29 @@ func RunGoodBad(good, bad, expected_words, expected_bad_words)
bwipe!
endfunc
func Test_spell_screendump()
CheckScreendump
let lines =<< trim END
call setline(1, [
\ "This is some text without any spell errors. Everything",
\ "should just be black, nothing wrong here.",
\ "",
\ "This line has a sepll error. and missing caps.",
\ "And and this is the the duplication.",
\ "with missing caps here.",
\ ])
set spell spelllang=en_nz
END
call writefile(lines, 'XtestSpell')
let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
call VerifyScreenDump(buf, 'Test_spell_1', {})
" clean up
call StopVimInTerminal(buf)
call delete('XtestSpell')
endfunc
let g:test_data_aff1 = [
\"SET ISO8859-1",
\"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
+11 -4
View File
@@ -538,9 +538,7 @@ func Test_syntax_c()
endif
call writefile([
\ '/* comment line at the top */',
\ ' int',
\ 'main(int argc, char **argv)// another comment',
\ '{',
\ 'int main(int argc, char **argv) { // another comment',
\ '#if 0',
\ ' int not_used;',
\ '#else',
@@ -549,12 +547,14 @@ func Test_syntax_c()
\ ' printf("Just an example piece of C code\n");',
\ ' return 0x0ff;',
\ '}',
\ "\t\t ",
\ ' static void',
\ 'myFunction(const double count, struct nothing, long there) {',
\ "\t// 123: nothing to read here",
\ "\t// 123: nothing to endif here",
\ "\tfor (int i = 0; i < count; ++i) {",
\ "\t break;",
\ "\t}",
\ "\tNote: asdf",
\ '}',
\ ], 'Xtest.c')
@@ -563,7 +563,14 @@ func Test_syntax_c()
let $COLORFGBG = '15;0'
let buf = RunVimInTerminal('Xtest.c', {})
call term_sendkeys(buf, ":syn keyword Search Note\r")
call term_sendkeys(buf, ":syn match Error /^\\s\\+$/\r")
call term_sendkeys(buf, ":set hlsearch\r")
call term_sendkeys(buf, "/endif\r")
call term_sendkeys(buf, "vjfC")
call VerifyScreenDump(buf, 'Test_syntax_c_01', {})
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
let $COLORFGBG = ''
+102 -5
View File
@@ -882,10 +882,35 @@ func Test_xx01_term_style_response()
set t_RV=
endfunc
" This checks the iTerm2 version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx02_iTerm2_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
" Old versions of iTerm2 used a different style term response.
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>0;95;c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('xterm', &ttymouse)
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>0;95;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('sgr', &ttymouse)
set t_RV=
endfunc
" This checks the libvterm version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx02_libvterm_response()
func Test_xx03_libvterm_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
@@ -899,14 +924,88 @@ func Test_xx02_libvterm_response()
set t_RV=
endfunc
" This checks the xterm version response.
" This checks the Mac Terminal.app version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx03_xterm_response()
func Test_xx04_Mac_Terminal_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>1;95;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('sgr', &ttymouse)
" Reset is_not_xterm and is_mac_terminal.
set t_RV=
set term=xterm
set t_RV=x
endfunc
" This checks the mintty version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx05_mintty_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>77;20905;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('sgr', &ttymouse)
set t_RV=
endfunc
" This checks the screen version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx06_screen_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
" Old versions of screen don't support SGR mouse mode.
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>83;40500;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('xterm', &ttymouse)
" screen supports SGR mouse mode starting in version 4.7.
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>83;40700;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('sgr', &ttymouse)
set t_RV=
endfunc
" This checks the xterm version response.
" This must be after other tests, because it has side effects to xterm
" properties.
func Test_xx07_xterm_response()
" Termresponse is only parsed when t_RV is not empty.
set t_RV=x
" Do Terminal.app first to check that is_mac_terminal is reset.
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>1;95;0c"
call feedkeys(seq, 'Lx!')
call assert_equal(seq, v:termresponse)
call assert_equal('sgr', &ttymouse)
" xterm < 95: "xterm" (actually unmodified)
set t_RV=
set term=xterm
set t_RV=x
set ttymouse=xterm
call test_option_not_set('ttymouse')
let seq = "\<Esc>[>0;94;0c"
@@ -933,8 +1032,6 @@ func Test_xx03_xterm_response()
set t_RV=
endfunc
" TODO: check other terminals response
func Test_get_termcode()
try
let k1 = &t_k1
+26
View File
@@ -1056,6 +1056,32 @@ func Test_terminal_qall_prompt()
quit
endfunc
" Run Vim in a terminal, then start a terminal window with a shell and check
" that Vim exits if it is closed.
func Test_terminal_exit()
CheckRunVimInTerminal
let lines =<< trim END
let winid = win_getid()
help
term
let termid = win_getid()
call win_gotoid(winid)
close
call win_gotoid(termid)
END
call writefile(lines, 'XtermExit')
let buf = RunVimInTerminal('-S XtermExit', #{rows: 10})
let job = term_getjob(buf)
call WaitForAssert({-> assert_equal("run", job_status(job))})
" quit the shell, it will make Vim exit
call term_sendkeys(buf, "exit\<CR>")
call WaitForAssert({-> assert_equal("dead", job_status(job))})
call delete('XtermExit')
endfunc
func Test_terminal_open_autocmd()
augroup repro
au!
+20
View File
@@ -1,4 +1,7 @@
" Tests for the various 'formatoptions' settings
source check.vim
func Test_text_format()
enew!
@@ -489,3 +492,20 @@ func Test_format_list_auto()
bwipe!
set fo& ai& bs&
endfunc
func Test_crash_github_issue_5095()
CheckFeature autocmd
" This used to segfault, see https://github.com/vim/vim/issues/5095
augroup testing
au BufNew x center
augroup END
next! x
bw
augroup testing
au!
augroup END
augroup! testing
endfunc
+6 -1
View File
@@ -1,4 +1,4 @@
" Tests for the writefile() function.
" Tests for the writefile() function and some :write commands.
func Test_writefile()
let f = tempname()
@@ -16,6 +16,11 @@ func Test_writefile()
call delete(f)
endfunc
func Test_writefile_ignore_regexp_error()
write Xt[z-a]est.txt
call delete('Xt[z-a]est.txt')
endfunc
func Test_writefile_fails_gently()
call assert_fails('call writefile(["test"], "Xfile", [])', 'E730:')
call assert_false(filereadable("Xfile"))
-2
View File
@@ -926,14 +926,12 @@ f_test_scrollbar(typval_T *argvars, typval_T *rettv UNUSED)
}
#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)
+62 -14
View File
@@ -364,15 +364,11 @@ static char *(features[]) =
"-mksession",
#endif
"+modify_fname",
#ifdef FEAT_MOUSE
"+mouse",
# ifdef FEAT_MOUSESHAPE
#ifdef FEAT_MOUSESHAPE
"+mouseshape",
# else
#else
"-mouseshape",
# endif
# else
"-mouse",
#endif
#if defined(UNIX) || defined(VMS)
@@ -407,11 +403,7 @@ static char *(features[]) =
#endif
#if defined(UNIX) || defined(VMS)
# ifdef FEAT_MOUSE_XTERM
"+mouse_sgr",
# else
"-mouse_sgr",
# endif
# ifdef FEAT_SYSMOUSE
"+mouse_sysmouse",
# else
@@ -422,11 +414,7 @@ static char *(features[]) =
# else
"-mouse_urxvt",
# endif
# ifdef FEAT_MOUSE_XTERM
"+mouse_xterm",
# else
"-mouse_xterm",
# endif
#endif
#ifdef FEAT_MBYTE_IME
@@ -768,6 +756,66 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2198,
/**/
2197,
/**/
2196,
/**/
2195,
/**/
2194,
/**/
2193,
/**/
2192,
/**/
2191,
/**/
2190,
/**/
2189,
/**/
2188,
/**/
2187,
/**/
2186,
/**/
2185,
/**/
2184,
/**/
2183,
/**/
2182,
/**/
2181,
/**/
2180,
/**/
2179,
/**/
2178,
/**/
2177,
/**/
2176,
/**/
2175,
/**/
2174,
/**/
2173,
/**/
2172,
/**/
2171,
/**/
2170,
/**/
2169,
/**/
2168,
/**/
+46 -43
View File
@@ -152,9 +152,6 @@
# 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.
@@ -815,6 +812,7 @@ extern int (*dyn_libintl_wputenv)(const wchar_t *envstring);
#define WILD_ICASE 0x100
#define WILD_ALLLINKS 0x200
#define WILD_IGNORE_COMPLETESLASH 0x400
#define WILD_NOERROR 0x800 // sets EW_NOERROR
// Flags for expand_wildcards()
#define EW_DIR 0x01 // include directory names
@@ -1820,80 +1818,78 @@ typedef int sock_T;
#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
#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
#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_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_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
#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_XTERM 0x40
# define MOUSE_DRAG (0x40 | MOUSE_RELEASE)
#define MOUSE_DRAG (0x40 | MOUSE_RELEASE)
// 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)
# define SET_NUM_MOUSE_CLICKS(code, num) \
#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
#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
#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
#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
#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
@@ -2120,6 +2116,13 @@ typedef enum {
FLUSH_INPUT // flush typebuf and inchar() input
} flush_buffers_T;
// Argument for prepare_tagpreview()
typedef enum {
USEPOPUP_NONE,
USEPOPUP_NORMAL, // use info popup
USEPOPUP_HIDDEN // use info popup initially hidden
} use_popup_T;
#include "ex_cmds.h" // Ex command defines
#include "spell.h" // spell checking stuff
-3
View File
@@ -5730,8 +5730,6 @@ win_setminwidth(void)
}
}
#if defined(FEAT_MOUSE) || defined(PROTO)
/*
* Status line of dragwin is dragged "offset" lines down (negative is up).
*/
@@ -5963,7 +5961,6 @@ win_drag_vsep_line(win_T *dragwin, int offset)
(void)win_comp_pos();
redraw_all_later(NOT_VALID);
}
#endif /* FEAT_MOUSE */
#define FRACTION_MULT 16384L