Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9fb77c692 | ||
|
|
7547a78446 | ||
|
|
36d1c0fef4 | ||
|
|
71dd9744cf | ||
|
|
7a9a5f4019 | ||
|
|
09de17536d | ||
|
|
2147746cf8 | ||
|
|
a772ec5e91 | ||
|
|
b73598e2f0 | ||
|
|
e4a76ad0e7 | ||
|
|
3a93838339 | ||
|
|
ba98bef191 | ||
|
|
a8e691d449 | ||
|
|
812ad4f3a2 | ||
|
|
c8ce615299 | ||
|
|
3321e9d8a3 | ||
|
|
472a0a880a | ||
|
|
00ff380295 | ||
|
|
8e97bd74b5 | ||
|
|
446cce6d53 | ||
|
|
5b4a3767f6 | ||
|
|
c96a2f3b88 | ||
|
|
328604307b | ||
|
|
83b3c3d8a0 | ||
|
|
66459b7c98 | ||
|
|
d76a0c15f8 | ||
|
|
7522f69821 | ||
|
|
7ab6defcaf | ||
|
|
7dc5e2e486 | ||
|
|
5971dab112 | ||
|
|
b650b9878e | ||
|
|
46c4d4ac66 | ||
|
|
c90f2aedd0 | ||
|
|
9d5b876d45 |
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Aug 02
|
||||
*eval.txt* For Vim version 7.4. Last change: 2016 Aug 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1969,7 +1969,7 @@ assert_exception({error} [, {msg}]) none assert {error} is in v:exception
|
||||
assert_fails({cmd} [, {error}]) none assert {cmd} fails
|
||||
assert_false({actual} [, {msg}]) none assert {actual} is false
|
||||
assert_inrange({lower}, {upper}, {actual} [, {msg}])
|
||||
none assert {actual} is inside the range
|
||||
none assert {actual} is inside the range
|
||||
assert_match({pat}, {text} [, {msg}]) none assert {pat} matches {text}
|
||||
assert_notequal({exp}, {act} [, {msg}]) none assert {exp} is not equal {act}
|
||||
assert_notmatch({pat}, {text} [, {msg}]) none assert {pat} not matches {text}
|
||||
@@ -2339,9 +2339,12 @@ test_null_list() List null value for testing
|
||||
test_null_partial() Funcref null value for testing
|
||||
test_null_string() String null value for testing
|
||||
test_settime({expr}) none set current time for testing
|
||||
timer_info([{id}]) List information about timers
|
||||
timer_pause({id}, {pause}) none pause or unpause a timer
|
||||
timer_start({time}, {callback} [, {options}])
|
||||
Number create a timer
|
||||
timer_stop({timer}) none stop a timer
|
||||
timer_stopall() none stop all timers
|
||||
tolower({expr}) String the String {expr} switched to lowercase
|
||||
toupper({expr}) String the String {expr} switched to uppercase
|
||||
tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
|
||||
@@ -3392,9 +3395,13 @@ exepath({expr}) *exepath()*
|
||||
an empty string is returned.
|
||||
|
||||
*exists()*
|
||||
exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
||||
defined, zero otherwise. The {expr} argument is a string,
|
||||
which contains one of these:
|
||||
exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
|
||||
zero otherwise.
|
||||
|
||||
For checking for a supported feature use |has()|.
|
||||
For checking if a file exists use |filereadable()|.
|
||||
|
||||
The {expr} argument is a string, which contains one of these:
|
||||
&option-name Vim option (only checks if it exists,
|
||||
not if it really works)
|
||||
+option-name Vim option that works.
|
||||
@@ -3442,7 +3449,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is
|
||||
event and pattern.
|
||||
##event autocommand for this event is
|
||||
supported.
|
||||
For checking for a supported feature use |has()|.
|
||||
|
||||
Examples: >
|
||||
exists("&shortname")
|
||||
@@ -5476,7 +5482,8 @@ matchadd({group}, {pattern}[, {priority}[, {id}[, {dict}]]])
|
||||
available from |getmatches()|. All matches can be deleted in
|
||||
one operation by |clearmatches()|.
|
||||
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()*
|
||||
*matchaddpos()*
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]])
|
||||
Same as |matchadd()|, but requires a list of positions {pos}
|
||||
instead of a pattern. This command is faster than |matchadd()|
|
||||
because it does not require to handle regular expressions and
|
||||
@@ -7536,6 +7543,41 @@ test_settime({expr}) *test_settime()*
|
||||
{expr} must evaluate to a number. When the value is zero the
|
||||
normal behavior is restored.
|
||||
|
||||
*timer_info()*
|
||||
timer_info([{id}])
|
||||
Return a list with information about timers.
|
||||
When {id} is given only information about this timer is
|
||||
returned. When timer {id} does not exist an empty list is
|
||||
returned.
|
||||
When {id} is omitted information about all timers is returned.
|
||||
|
||||
For each timer the information is stored in a Dictionary with
|
||||
these items:
|
||||
"id" the timer ID
|
||||
"time" time the timer was started with
|
||||
"remaining" time until the timer fires
|
||||
"repeat" number of times the timer will still fire;
|
||||
-1 means forever
|
||||
"callback" the callback
|
||||
"paused" 1 if the timer is paused, 0 otherwise
|
||||
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
timer_pause({timer}, {paused}) *timer_pause()*
|
||||
Pause or unpause a timer. A paused timer does not invoke its
|
||||
callback, while the time it would is not changed. Unpausing a
|
||||
timer may cause the callback to be invoked almost immediately
|
||||
if enough time has passed.
|
||||
|
||||
Pausing a timer is useful to avoid the callback to be called
|
||||
for a short time.
|
||||
|
||||
If {paused} evaluates to a non-zero Number or a non-empty
|
||||
String, then the timer is paused, otherwise it is unpaused.
|
||||
See |non-zero-arg|.
|
||||
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
*timer_start()*
|
||||
timer_start({time}, {callback} [, {options}])
|
||||
Create a timer and return the timer ID.
|
||||
@@ -7561,12 +7603,22 @@ timer_start({time}, {callback} [, {options}])
|
||||
\ {'repeat': 3})
|
||||
< This will invoke MyHandler() three times at 500 msec
|
||||
intervals.
|
||||
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
timer_stop({timer}) *timer_stop()*
|
||||
Stop a timer. The timer callback will no longer be invoked.
|
||||
{timer} is an ID returned by timer_start(), thus it must be a
|
||||
Number.
|
||||
Number. If {timer} does not exist there is no error.
|
||||
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
timer_stopall() *timer_stopall()*
|
||||
Stop all timers. The timer callbacks will no longer be
|
||||
invoked. Useful if some timers is misbehaving. If there are
|
||||
no timers there is no error.
|
||||
|
||||
{only available when compiled with the |+timers| feature}
|
||||
|
||||
tolower({expr}) *tolower()*
|
||||
The result is a copy of the String given, with all uppercase
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 7.4. Last change: 2016 Jul 29
|
||||
*starting.txt* For Vim version 7.4. Last change: 2016 Aug 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -858,6 +858,8 @@ accordingly. Vim proceeds in this order:
|
||||
searched for the "plugin" sub-directory and all files ending in ".vim"
|
||||
will be sourced (in alphabetical order per directory), also in
|
||||
subdirectories.
|
||||
However, directories in 'runtimepath' ending in "after" are skipped
|
||||
here and only loaded after packages, see below.
|
||||
Loading plugins won't be done when:
|
||||
- The 'loadplugins' option was reset in a vimrc file.
|
||||
- The |--noplugin| command line argument is used.
|
||||
@@ -865,13 +867,18 @@ accordingly. Vim proceeds in this order:
|
||||
- When Vim was compiled without the |+eval| feature.
|
||||
Note that using "-c 'set noloadplugins'" doesn't work, because the
|
||||
commands from the command line have not been executed yet. You can
|
||||
use "--cmd 'set noloadplugins'" |--cmd|.
|
||||
use "--cmd 'set noloadplugins'" or "--cmd 'set loadplugins'" |--cmd|.
|
||||
|
||||
Packages are loaded. These are plugins, as above, but found in the
|
||||
"start" directory of each entry in 'packpath'. Every plugin directory
|
||||
found is added in 'runtimepath' and then the plugins are sourced. See
|
||||
|packages|.
|
||||
|
||||
The plugins scripts are loaded, as above, but now only the directories
|
||||
ending in "after" are used. Note that 'runtimepath' will have changed
|
||||
if packages have been found, but that should not add a directory
|
||||
ending in "after".
|
||||
|
||||
5. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
value of the 'shell' option, unless they have been set before.
|
||||
|
||||
11
src/Makefile
11
src/Makefile
@@ -2031,9 +2031,7 @@ test1 \
|
||||
test_mapping \
|
||||
test_marks \
|
||||
test_nested_function \
|
||||
test_options \
|
||||
test_search_mbyte \
|
||||
test_signs \
|
||||
test_tagcase \
|
||||
test_utf8 \
|
||||
test_wordcount \
|
||||
@@ -2044,7 +2042,7 @@ test1 \
|
||||
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
|
||||
test40 test41 test42 test43 test44 test45 test46 test48 test49 \
|
||||
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
|
||||
test60 test62 test63 test64 test65 test66 test67 test68 test69 \
|
||||
test60 test62 test64 test65 test66 test67 test68 test69 \
|
||||
test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \
|
||||
test80 test81 test82 test83 test84 test85 test86 test87 test88 test89 \
|
||||
test90 test91 test92 test93 test94 test95 test97 test98 test99 \
|
||||
@@ -2086,6 +2084,7 @@ test_arglist \
|
||||
test_history \
|
||||
test_increment \
|
||||
test_increment_dbcs \
|
||||
test_job_fails \
|
||||
test_join \
|
||||
test_json \
|
||||
test_jumps \
|
||||
@@ -2094,12 +2093,13 @@ test_arglist \
|
||||
test_largefile \
|
||||
test_lispwords \
|
||||
test_man \
|
||||
test_match \
|
||||
test_matchadd_conceal \
|
||||
test_matchadd_conceal_utf8 \
|
||||
test_matchstrpos \
|
||||
test_menu \
|
||||
test_messages \
|
||||
test_netbeans \
|
||||
test_options \
|
||||
test_packadd \
|
||||
test_partial \
|
||||
test_perl \
|
||||
@@ -2109,10 +2109,11 @@ test_arglist \
|
||||
test_regexp_utf8 \
|
||||
test_reltime \
|
||||
test_ruby \
|
||||
test_startup \
|
||||
test_searchpos \
|
||||
test_set \
|
||||
test_signs \
|
||||
test_sort \
|
||||
test_startup \
|
||||
test_stat \
|
||||
test_statusline \
|
||||
test_syn_attr \
|
||||
|
||||
@@ -418,6 +418,7 @@ dict_find(dict_T *d, char_u *key, int len)
|
||||
/*
|
||||
* Get a string item from a dictionary.
|
||||
* When "save" is TRUE allocate memory for it.
|
||||
* When FALSE a shared buffer is used, can only be used once!
|
||||
* Returns NULL if the entry doesn't exist or out of memory.
|
||||
*/
|
||||
char_u *
|
||||
|
||||
@@ -3893,7 +3893,7 @@ ins_compl_prep(int c)
|
||||
|
||||
/* CTRL-E means completion is Ended, go back to the typed text.
|
||||
* but only do this, if the Popup is still visible */
|
||||
if (c == Ctrl_E && pum_visible())
|
||||
if (c == Ctrl_E)
|
||||
{
|
||||
ins_compl_delete();
|
||||
if (compl_leader != NULL)
|
||||
|
||||
@@ -396,8 +396,11 @@ static void f_tan(typval_T *argvars, typval_T *rettv);
|
||||
static void f_tanh(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
#ifdef FEAT_TIMERS
|
||||
static void f_timer_info(typval_T *argvars, typval_T *rettv);
|
||||
static void f_timer_pause(typval_T *argvars, typval_T *rettv);
|
||||
static void f_timer_start(typval_T *argvars, typval_T *rettv);
|
||||
static void f_timer_stop(typval_T *argvars, typval_T *rettv);
|
||||
static void f_timer_stopall(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
static void f_tolower(typval_T *argvars, typval_T *rettv);
|
||||
static void f_toupper(typval_T *argvars, typval_T *rettv);
|
||||
@@ -815,8 +818,11 @@ static struct fst
|
||||
{"test_null_string", 0, 0, f_test_null_string},
|
||||
{"test_settime", 1, 1, f_test_settime},
|
||||
#ifdef FEAT_TIMERS
|
||||
{"timer_info", 0, 1, f_timer_info},
|
||||
{"timer_pause", 2, 2, f_timer_pause},
|
||||
{"timer_start", 2, 3, f_timer_start},
|
||||
{"timer_stop", 1, 1, f_timer_stop},
|
||||
{"timer_stopall", 0, 0, f_timer_stopall},
|
||||
#endif
|
||||
{"tolower", 1, 1, f_tolower},
|
||||
{"toupper", 1, 1, f_toupper},
|
||||
@@ -4240,6 +4246,20 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
|
||||
xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
|
||||
}
|
||||
# endif
|
||||
#ifdef FEAT_CSCOPE
|
||||
if (xpc.xp_context == EXPAND_CSCOPE)
|
||||
{
|
||||
set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope);
|
||||
xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_SIGNS
|
||||
if (xpc.xp_context == EXPAND_SIGN)
|
||||
{
|
||||
set_context_in_sign_cmd(&xpc, xpc.xp_pattern);
|
||||
xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
|
||||
}
|
||||
#endif
|
||||
|
||||
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
||||
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))
|
||||
@@ -9652,11 +9672,11 @@ f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
group = get_dict_string(d, (char_u *)"group", FALSE);
|
||||
group = get_dict_string(d, (char_u *)"group", TRUE);
|
||||
priority = (int)get_dict_number(d, (char_u *)"priority");
|
||||
id = (int)get_dict_number(d, (char_u *)"id");
|
||||
conceal = dict_find(d, (char_u *)"conceal", -1) != NULL
|
||||
? get_dict_string(d, (char_u *)"conceal", FALSE)
|
||||
? get_dict_string(d, (char_u *)"conceal", TRUE)
|
||||
: NULL;
|
||||
if (i == 0)
|
||||
{
|
||||
@@ -9670,6 +9690,8 @@ f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
list_unref(s);
|
||||
s = NULL;
|
||||
}
|
||||
vim_free(group);
|
||||
vim_free(conceal);
|
||||
|
||||
li = li->li_next;
|
||||
}
|
||||
@@ -11944,6 +11966,50 @@ free_callback(char_u *callback, partial_T *partial)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TIMERS
|
||||
/*
|
||||
* "timer_info([timer])" function
|
||||
*/
|
||||
static void
|
||||
f_timer_info(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
timer_T *timer = NULL;
|
||||
|
||||
if (rettv_list_alloc(rettv) != OK)
|
||||
return;
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (argvars[0].v_type != VAR_NUMBER)
|
||||
EMSG(_(e_number_exp));
|
||||
else
|
||||
{
|
||||
timer = find_timer((int)get_tv_number(&argvars[0]));
|
||||
if (timer != NULL)
|
||||
add_timer_info(rettv, timer);
|
||||
}
|
||||
}
|
||||
else
|
||||
add_timer_info_all(rettv);
|
||||
}
|
||||
|
||||
/*
|
||||
* "timer_pause(timer, paused)" function
|
||||
*/
|
||||
static void
|
||||
f_timer_pause(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
timer_T *timer = NULL;
|
||||
int paused = (int)get_tv_number(&argvars[1]);
|
||||
|
||||
if (argvars[0].v_type != VAR_NUMBER)
|
||||
EMSG(_(e_number_exp));
|
||||
else
|
||||
{
|
||||
timer = find_timer((int)get_tv_number(&argvars[0]));
|
||||
if (timer != NULL)
|
||||
timer->tr_paused = paused;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "timer_start(time, callback [, options])" function
|
||||
*/
|
||||
@@ -12005,6 +12071,15 @@ f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
if (timer != NULL)
|
||||
stop_timer(timer);
|
||||
}
|
||||
|
||||
/*
|
||||
* "timer_stopall()" function
|
||||
*/
|
||||
static void
|
||||
f_timer_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
{
|
||||
stop_all_timers();
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1139,10 +1139,8 @@ create_timer(long msec, int repeat)
|
||||
timer->tr_id = ++last_timer_id;
|
||||
insert_timer(timer);
|
||||
if (repeat != 0)
|
||||
{
|
||||
timer->tr_repeat = repeat - 1;
|
||||
timer->tr_interval = msec;
|
||||
}
|
||||
timer->tr_interval = msec;
|
||||
|
||||
profile_setlimit(msec, &timer->tr_due);
|
||||
return timer;
|
||||
@@ -1191,6 +1189,8 @@ check_due_timer(void)
|
||||
next_due = -1;
|
||||
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
|
||||
{
|
||||
if (timer->tr_paused)
|
||||
continue;
|
||||
# ifdef WIN3264
|
||||
this_due = (long)(((double)(timer->tr_due.QuadPart - now.QuadPart)
|
||||
/ (double)fr.QuadPart) * 1000);
|
||||
@@ -1253,6 +1253,76 @@ stop_timer(timer_T *timer)
|
||||
free_timer(timer);
|
||||
}
|
||||
|
||||
void
|
||||
stop_all_timers(void)
|
||||
{
|
||||
while (first_timer != NULL)
|
||||
stop_timer(first_timer);
|
||||
}
|
||||
|
||||
void
|
||||
add_timer_info(typval_T *rettv, timer_T *timer)
|
||||
{
|
||||
list_T *list = rettv->vval.v_list;
|
||||
dict_T *dict = dict_alloc();
|
||||
dictitem_T *di;
|
||||
long remaining;
|
||||
proftime_T now;
|
||||
# ifdef WIN3264
|
||||
LARGE_INTEGER fr;
|
||||
#endif
|
||||
|
||||
if (dict == NULL)
|
||||
return;
|
||||
list_append_dict(list, dict);
|
||||
|
||||
dict_add_nr_str(dict, "id", (long)timer->tr_id, NULL);
|
||||
dict_add_nr_str(dict, "time", (long)timer->tr_interval, NULL);
|
||||
|
||||
profile_start(&now);
|
||||
# ifdef WIN3264
|
||||
QueryPerformanceFrequency(&fr);
|
||||
remaining = (long)(((double)(timer->tr_due.QuadPart - now.QuadPart)
|
||||
/ (double)fr.QuadPart) * 1000);
|
||||
# else
|
||||
remaining = (timer->tr_due.tv_sec - now.tv_sec) * 1000
|
||||
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000;
|
||||
# endif
|
||||
dict_add_nr_str(dict, "remaining", (long)remaining, NULL);
|
||||
|
||||
dict_add_nr_str(dict, "repeat",
|
||||
(long)(timer->tr_repeat < 0 ? -1 : timer->tr_repeat + 1), NULL);
|
||||
dict_add_nr_str(dict, "paused", (long)(timer->tr_paused), NULL);
|
||||
|
||||
di = dictitem_alloc((char_u *)"callback");
|
||||
if (di != NULL)
|
||||
{
|
||||
if (dict_add(dict, di) == FAIL)
|
||||
vim_free(di);
|
||||
else if (timer->tr_partial != NULL)
|
||||
{
|
||||
di->di_tv.v_type = VAR_PARTIAL;
|
||||
di->di_tv.vval.v_partial = timer->tr_partial;
|
||||
++timer->tr_partial->pt_refcount;
|
||||
}
|
||||
else
|
||||
{
|
||||
di->di_tv.v_type = VAR_FUNC;
|
||||
di->di_tv.vval.v_string = vim_strsave(timer->tr_callback);
|
||||
}
|
||||
di->di_tv.v_lock = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
add_timer_info_all(typval_T *rettv)
|
||||
{
|
||||
timer_T *timer;
|
||||
|
||||
for (timer = first_timer; timer != NULL; timer = timer->tr_next)
|
||||
add_timer_info(rettv, timer);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark references in partials of timers.
|
||||
*/
|
||||
@@ -3240,15 +3310,30 @@ do_in_path(
|
||||
rtp = rtp_copy;
|
||||
while (*rtp != NUL && ((flags & DIP_ALL) || !did_one))
|
||||
{
|
||||
size_t buflen;
|
||||
|
||||
/* Copy the path from 'runtimepath' to buf[]. */
|
||||
copy_option_part(&rtp, buf, MAXPATHL, ",");
|
||||
buflen = STRLEN(buf);
|
||||
|
||||
/* Skip after or non-after directories. */
|
||||
if (flags & (DIP_NOAFTER | DIP_AFTER))
|
||||
{
|
||||
int is_after = buflen >= 5
|
||||
&& STRCMP(buf + buflen - 5, "after") == 0;
|
||||
|
||||
if ((is_after && (flags & DIP_NOAFTER))
|
||||
|| (!is_after && (flags & DIP_AFTER)))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == NULL)
|
||||
{
|
||||
(*callback)(buf, (void *) &cookie);
|
||||
if (!did_one)
|
||||
did_one = (cookie == NULL);
|
||||
}
|
||||
else if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL)
|
||||
else if (buflen + STRLEN(name) + 2 < MAXPATHL)
|
||||
{
|
||||
add_pathsep(buf);
|
||||
tail = buf + STRLEN(buf);
|
||||
@@ -3512,6 +3597,7 @@ static int did_source_packages = FALSE;
|
||||
/*
|
||||
* ":packloadall"
|
||||
* Find plugins in the package directories and source them.
|
||||
* "eap" is NULL when invoked during startup.
|
||||
*/
|
||||
void
|
||||
ex_packloadall(exarg_T *eap)
|
||||
|
||||
@@ -1009,8 +1009,11 @@ static intptr_t _tls_index = 0;
|
||||
#endif
|
||||
|
||||
int
|
||||
mzscheme_main(int argc, char** argv)
|
||||
mzscheme_main()
|
||||
{
|
||||
int argc = 0;
|
||||
char *argv = NULL;
|
||||
|
||||
#ifdef DYNAMIC_MZSCHEME
|
||||
/*
|
||||
* Racket requires trampolined startup. We can not load it later.
|
||||
@@ -1019,16 +1022,16 @@ mzscheme_main(int argc, char** argv)
|
||||
if (!mzscheme_enabled(FALSE))
|
||||
{
|
||||
disabled = TRUE;
|
||||
return vim_main2(argc, argv);
|
||||
return vim_main2();
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_TLS_SPACE
|
||||
scheme_register_tls_space(&tls_space, _tls_index);
|
||||
#endif
|
||||
#ifdef TRAMPOLINED_MZVIM_STARTUP
|
||||
return scheme_main_setup(TRUE, mzscheme_env_main, argc, argv);
|
||||
return scheme_main_setup(TRUE, mzscheme_env_main, argc, &argv);
|
||||
#else
|
||||
return mzscheme_env_main(NULL, argc, argv);
|
||||
return mzscheme_env_main(NULL, argc, &argv);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1056,7 +1059,7 @@ mzscheme_env_main(Scheme_Env *env, int argc, char **argv)
|
||||
* We trampoline into vim_main2
|
||||
* Passing argc, argv through from mzscheme_main
|
||||
*/
|
||||
vim_main_result = vim_main2(argc, argv);
|
||||
vim_main_result = vim_main2();
|
||||
#if !defined(TRAMPOLINED_MZVIM_STARTUP) && defined(MZ_PRECISE_GC)
|
||||
/* releasing dummy */
|
||||
MZ_GC_REG();
|
||||
|
||||
89
src/main.c
89
src/main.c
@@ -92,6 +92,9 @@ static char_u *start_dir = NULL; /* current working dir on startup */
|
||||
|
||||
static int has_dash_c_arg = FALSE;
|
||||
|
||||
/* Various parameters passed between main() and other functions. */
|
||||
static mparm_T params;
|
||||
|
||||
int
|
||||
# ifdef VIMDLL
|
||||
_export
|
||||
@@ -106,9 +109,6 @@ main
|
||||
# endif
|
||||
(int argc, char **argv)
|
||||
{
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
* main() and other functions. */
|
||||
#ifdef STARTUPTIME
|
||||
int i;
|
||||
#endif
|
||||
@@ -157,6 +157,7 @@ main
|
||||
#endif
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
/* Need to find "--startuptime" before actually parsing arguments. */
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
|
||||
@@ -241,7 +242,7 @@ main
|
||||
mch_chdir((char *)start_dir);
|
||||
}
|
||||
#endif
|
||||
fname = alist_name(&GARGLIST[0]);
|
||||
params.fname = alist_name(&GARGLIST[0]);
|
||||
}
|
||||
|
||||
#if defined(WIN32) && defined(FEAT_MBYTE)
|
||||
@@ -263,7 +264,7 @@ main
|
||||
* Hint: to avoid this when typing a command use a forward slash.
|
||||
* If the cd fails, it doesn't matter.
|
||||
*/
|
||||
(void)vim_chdirfile(fname);
|
||||
(void)vim_chdirfile(params.fname);
|
||||
if (start_dir != NULL)
|
||||
mch_dirname(start_dir, MAXPATHL);
|
||||
}
|
||||
@@ -281,7 +282,7 @@ main
|
||||
/*
|
||||
* When listing swap file names, don't do cursor positioning et. al.
|
||||
*/
|
||||
if (recoverymode && fname == NULL)
|
||||
if (recoverymode && params.fname == NULL)
|
||||
params.want_full_screen = FALSE;
|
||||
|
||||
/*
|
||||
@@ -312,8 +313,8 @@ main
|
||||
if (getcwd((char *)NameBuff, MAXPATHL) != NULL
|
||||
&& STRCMP(NameBuff, "/") == 0)
|
||||
{
|
||||
if (fname != NULL)
|
||||
(void)vim_chdirfile(fname);
|
||||
if (params.fname != NULL)
|
||||
(void)vim_chdirfile(params.fname);
|
||||
else
|
||||
{
|
||||
expand_env((char_u *)"$HOME", NameBuff, MAXPATHL);
|
||||
@@ -407,38 +408,29 @@ main
|
||||
* Newer version of MzScheme (Racket) require earlier (trampolined)
|
||||
* initialisation via scheme_main_setup.
|
||||
* Implement this by initialising it as early as possible
|
||||
* and splitting off remaining Vim main into vim_main2
|
||||
* and splitting off remaining Vim main into vim_main2().
|
||||
*/
|
||||
{
|
||||
/* Pack up preprocessed command line arguments.
|
||||
* It is safe because Scheme does not access argc/argv. */
|
||||
char *args[2];
|
||||
args[0] = (char *)fname;
|
||||
args[1] = (char *)¶ms;
|
||||
return mzscheme_main(2, args);
|
||||
}
|
||||
}
|
||||
return mzscheme_main();
|
||||
#else
|
||||
return vim_main2();
|
||||
#endif
|
||||
}
|
||||
#endif /* NO_VIM_MAIN */
|
||||
|
||||
/* vim_main2() needs to be produced when FEAT_MZSCHEME is defined even when
|
||||
* NO_VIM_MAIN is defined. */
|
||||
#ifdef FEAT_MZSCHEME
|
||||
/*
|
||||
* vim_main2() is needed for FEAT_MZSCHEME, but we define it always to keep
|
||||
* things simple.
|
||||
* It is also defined when NO_VIM_MAIN is defined, but then it's empty.
|
||||
*/
|
||||
int
|
||||
vim_main2(int argc UNUSED, char **argv UNUSED)
|
||||
vim_main2(void)
|
||||
{
|
||||
# ifndef NO_VIM_MAIN
|
||||
char_u *fname = (char_u *)argv[0];
|
||||
mparm_T params;
|
||||
|
||||
memcpy(¶ms, argv[1], sizeof(params));
|
||||
# else
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_VIM_MAIN
|
||||
/* Reset 'loadplugins' for "-u NONE" before "--cmd" arguments.
|
||||
* Allows for setting 'loadplugins' there. */
|
||||
if (params.use_vimrc != NULL && STRCMP(params.use_vimrc, "NONE") == 0)
|
||||
p_lpl = FALSE;
|
||||
|
||||
/* Execute --cmd arguments. */
|
||||
exe_pre_commands(¶ms);
|
||||
|
||||
@@ -453,14 +445,22 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
|
||||
if (p_lpl)
|
||||
{
|
||||
# ifdef VMS /* Somehow VMS doesn't handle the "**". */
|
||||
source_runtime((char_u *)"plugin/*.vim", DIP_ALL);
|
||||
source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_NOAFTER);
|
||||
# else
|
||||
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL);
|
||||
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_NOAFTER);
|
||||
# endif
|
||||
TIME_MSG("loading plugins");
|
||||
|
||||
ex_packloadall(NULL);
|
||||
TIME_MSG("loading packages");
|
||||
|
||||
# ifdef VMS /* Somehow VMS doesn't handle the "**". */
|
||||
source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_AFTER);
|
||||
# else
|
||||
source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_AFTER);
|
||||
# endif
|
||||
TIME_MSG("loading after plugins");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -480,7 +480,7 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
|
||||
* This uses the 'dir' option, therefore it must be after the
|
||||
* initializations.
|
||||
*/
|
||||
if (recoverymode && fname == NULL)
|
||||
if (recoverymode && params.fname == NULL)
|
||||
{
|
||||
recover_names(NULL, TRUE, 0, NULL);
|
||||
mch_exit(0);
|
||||
@@ -875,16 +875,17 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
|
||||
*/
|
||||
main_loop(FALSE, FALSE);
|
||||
|
||||
#endif /* NO_VIM_MAIN */
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* NO_VIM_MAIN */
|
||||
#endif /* PROTO */
|
||||
|
||||
/*
|
||||
* Initialisation shared by main() and some tests.
|
||||
*/
|
||||
void
|
||||
common_init(mparm_T *params)
|
||||
common_init(mparm_T *paramp)
|
||||
{
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -901,7 +902,7 @@ common_init(mparm_T *params)
|
||||
#ifdef MAC_OS_CLASSIC
|
||||
/* Prepare for possibly starting GUI sometime */
|
||||
/* Macintosh needs this before any memory is allocated. */
|
||||
gui_prepare(¶ms->argc, params->argv);
|
||||
gui_prepare(¶mp->argc, paramp->argv);
|
||||
TIME_MSG("GUI prepared");
|
||||
#endif
|
||||
|
||||
@@ -950,14 +951,14 @@ common_init(mparm_T *params)
|
||||
* --socketid
|
||||
* --windowid
|
||||
*/
|
||||
early_arg_scan(params);
|
||||
early_arg_scan(paramp);
|
||||
|
||||
#ifdef FEAT_SUN_WORKSHOP
|
||||
findYourself(params->argv[0]);
|
||||
findYourself(paramp->argv[0]);
|
||||
#endif
|
||||
#if defined(FEAT_GUI) && !defined(MAC_OS_CLASSIC)
|
||||
/* Prepare for possibly starting GUI sometime */
|
||||
gui_prepare(¶ms->argc, params->argv);
|
||||
gui_prepare(¶mp->argc, paramp->argv);
|
||||
TIME_MSG("GUI prepared");
|
||||
#endif
|
||||
|
||||
@@ -972,7 +973,7 @@ common_init(mparm_T *params)
|
||||
* (needed for :! to * work). mch_check_win() will also handle the -d or
|
||||
* -dev argument.
|
||||
*/
|
||||
params->stdout_isatty = (mch_check_win(params->argc, params->argv) != FAIL);
|
||||
paramp->stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
|
||||
TIME_MSG("window checked");
|
||||
|
||||
/*
|
||||
@@ -2945,8 +2946,6 @@ source_startup_scripts(mparm_T *parmp)
|
||||
if (use_gvimrc == NULL) /* don't load gvimrc either */
|
||||
use_gvimrc = parmp->use_vimrc;
|
||||
#endif
|
||||
if (parmp->use_vimrc[2] == 'N')
|
||||
p_lpl = FALSE; /* don't load plugins either */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
26
src/option.c
26
src/option.c
@@ -4919,12 +4919,30 @@ do_set(
|
||||
{
|
||||
/* Remove flags that appear twice. */
|
||||
for (s = newval; *s; ++s)
|
||||
if ((!(flags & P_COMMA) || *s != ',')
|
||||
&& vim_strchr(s + 1, *s) != NULL)
|
||||
{
|
||||
/* if options have P_FLAGLIST and
|
||||
* P_ONECOMMA such as 'whichwrap' */
|
||||
if (flags & P_ONECOMMA)
|
||||
{
|
||||
STRMOVE(s, s + 1);
|
||||
--s;
|
||||
if (*s != ',' && *(s + 1) == ','
|
||||
&& vim_strchr(s + 2, *s) != NULL)
|
||||
{
|
||||
/* Remove the duplicated value and
|
||||
* the next comma. */
|
||||
STRMOVE(s, s + 2);
|
||||
s -= 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!(flags & P_COMMA) || *s != ',')
|
||||
&& vim_strchr(s + 1, *s) != NULL)
|
||||
{
|
||||
STRMOVE(s, s + 1);
|
||||
--s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (save_arg != NULL) /* number for 'whichwrap' */
|
||||
|
||||
@@ -577,7 +577,7 @@ null_libintl_ngettext(
|
||||
const char *msgid_plural,
|
||||
unsigned long n)
|
||||
{
|
||||
return n == 1 ? msgid : msgid_plural;
|
||||
return (char *)(n == 1 ? msgid : msgid_plural);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
||||
@@ -22,6 +22,9 @@ timer_T *create_timer(long msec, int repeat);
|
||||
long check_due_timer(void);
|
||||
timer_T *find_timer(int id);
|
||||
void stop_timer(timer_T *timer);
|
||||
void stop_all_timers(void);
|
||||
void add_timer_info(typval_T *rettv, timer_T *timer);
|
||||
void add_timer_info_all(typval_T *rettv);
|
||||
int set_ref_in_timer(int copyID);
|
||||
void timer_free_all(void);
|
||||
void profile_divide(proftime_T *tm, int count, proftime_T *tm2);
|
||||
|
||||
@@ -3,7 +3,7 @@ int mzscheme_enabled(int verbose);
|
||||
void mzvim_check_threads(void);
|
||||
void mzvim_reset_timer(void);
|
||||
void mzscheme_end(void);
|
||||
int mzscheme_main(int argc, char **argv);
|
||||
int mzscheme_main(void);
|
||||
void mzscheme_buffer_free(buf_T *buf);
|
||||
void mzscheme_window_free(win_T *win);
|
||||
void ex_mzscheme(exarg_T *eap);
|
||||
|
||||
@@ -3159,8 +3159,9 @@ struct timer_S
|
||||
timer_T *tr_next;
|
||||
timer_T *tr_prev;
|
||||
proftime_T tr_due; /* when the callback is to be invoked */
|
||||
int tr_paused; /* when TRUE callback is not invoked */
|
||||
int tr_repeat; /* number of times to repeat, -1 forever */
|
||||
long tr_interval; /* only set when it repeats */
|
||||
long tr_interval; /* msec */
|
||||
char_u *tr_callback; /* allocated */
|
||||
partial_T *tr_partial;
|
||||
#endif
|
||||
@@ -3180,6 +3181,8 @@ typedef struct
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
char_u *fname; /* first file to edit */
|
||||
|
||||
int evim_mode; /* started as "evim" */
|
||||
char_u *use_vimrc; /* vimrc from -u argument */
|
||||
|
||||
|
||||
@@ -6104,6 +6104,7 @@ gui_get_color_cmn(char_u *name)
|
||||
{(char_u *)"gray", RGB(0xBE, 0xBE, 0xBE)},
|
||||
{(char_u *)"green", RGB(0x00, 0xFF, 0x00)},
|
||||
{(char_u *)"grey", RGB(0xBE, 0xBE, 0xBE)},
|
||||
{(char_u *)"grey40", RGB(0x66, 0x66, 0x66)},
|
||||
{(char_u *)"grey90", RGB(0xE5, 0xE5, 0xE5)},
|
||||
{(char_u *)"lightblue", RGB(0xAD, 0xD8, 0xE6)},
|
||||
{(char_u *)"lightcyan", RGB(0xE0, 0xFF, 0xFF)},
|
||||
|
||||
@@ -51,7 +51,6 @@ SCRIPTS_ALL = \
|
||||
test57.out \
|
||||
test60.out \
|
||||
test62.out \
|
||||
test63.out \
|
||||
test64.out \
|
||||
test65.out \
|
||||
test66.out \
|
||||
@@ -102,9 +101,7 @@ SCRIPTS_ALL = \
|
||||
test_mapping.out \
|
||||
test_marks.out \
|
||||
test_nested_function.out \
|
||||
test_options.out \
|
||||
test_search_mbyte.out \
|
||||
test_signs.out \
|
||||
test_tagcase.out \
|
||||
test_utf8.out \
|
||||
test_wordcount.out \
|
||||
@@ -176,6 +173,7 @@ NEW_TESTS = test_arglist.res \
|
||||
test_history.res \
|
||||
test_increment.res \
|
||||
test_increment_dbcs.res \
|
||||
test_job_fails.res \
|
||||
test_json.res \
|
||||
test_langmap.res \
|
||||
test_man.res \
|
||||
@@ -185,6 +183,7 @@ NEW_TESTS = test_arglist.res \
|
||||
test_perl.res \
|
||||
test_quickfix.res \
|
||||
test_ruby.res \
|
||||
test_signs.res \
|
||||
test_startup.res \
|
||||
test_stat.res \
|
||||
test_syntax.res \
|
||||
|
||||
@@ -114,4 +114,6 @@ bench_re_freeze.out: bench_re_freeze.vim
|
||||
newtests: $(NEW_TESTS)
|
||||
|
||||
.vim.res:
|
||||
@echo "$(VIMPROG)" > vimcmd
|
||||
$(VIMPROG) -u NONE $(NO_PLUGIN) -S runtest.vim $*.vim
|
||||
@del vimcmd
|
||||
|
||||
@@ -48,21 +48,21 @@ $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) $(NEW_TESTS): $(SCRIPTS_FIRST)
|
||||
.SUFFIXES: .in .out .res .vim
|
||||
|
||||
vimall: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS_WIN32) newtests
|
||||
echo ALL DONE
|
||||
@echo ALL DONE
|
||||
|
||||
nongui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) newtests
|
||||
echo ALL DONE
|
||||
@echo ALL DONE
|
||||
|
||||
benchmark: $(SCRIPTS_BENCH)
|
||||
|
||||
small: nolog
|
||||
echo ALL DONE
|
||||
@echo ALL DONE
|
||||
|
||||
gui: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) newtests
|
||||
echo ALL DONE
|
||||
@echo ALL DONE
|
||||
|
||||
win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
|
||||
echo ALL DONE
|
||||
@echo ALL DONE
|
||||
|
||||
# TODO: find a way to avoid changing the distributed files.
|
||||
fixff:
|
||||
@@ -117,5 +117,7 @@ bench_re_freeze.out: bench_re_freeze.vim
|
||||
newtests: $(NEW_TESTS)
|
||||
|
||||
.vim.res:
|
||||
@echo "$(VIMPROG)" > vimcmd
|
||||
$(VIMPROG) -u NONE $(NO_PLUGIN) -S runtest.vim $*.vim
|
||||
@$(DEL) vimcmd
|
||||
|
||||
|
||||
@@ -127,4 +127,6 @@ newtestssilent: $(NEW_TESTS)
|
||||
|
||||
|
||||
.vim.res:
|
||||
$(RUN_VIMTEST) -u NONE -U NONE -S runtest.vim $*.vim
|
||||
@echo "$(RUN_VIMTEST)" > vimcmd
|
||||
$(RUN_VIMTEST) -U NONE -S runtest.vim $*.vim
|
||||
@rm vimcmd
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
" Common preparations for running tests.
|
||||
|
||||
" Make sure 'runtimepath' does not include $HOME.
|
||||
" Make sure 'runtimepath' and 'packpath' does not include $HOME.
|
||||
set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
|
||||
if has('packages')
|
||||
let &packpath = &rtp
|
||||
endif
|
||||
|
||||
" Only when the +eval feature is present.
|
||||
if 1
|
||||
|
||||
@@ -109,14 +109,62 @@ func s:kill_server(cmd)
|
||||
endfunc
|
||||
|
||||
" Wait for up to a second for "expr" to become true.
|
||||
" Return time slept in milliseconds.
|
||||
func WaitFor(expr)
|
||||
let slept = 0
|
||||
for i in range(100)
|
||||
try
|
||||
if eval(a:expr)
|
||||
return
|
||||
return slept
|
||||
endif
|
||||
catch
|
||||
endtry
|
||||
let slept += 10
|
||||
sleep 10m
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Run Vim, using the "vimcmd" file and "-u NORC".
|
||||
" "before" is a list of Vim commands to be executed before loading plugins.
|
||||
" "after" is a list of Vim commands to be executed after loading plugins.
|
||||
" Plugins are not loaded, unless 'loadplugins' is set in "before".
|
||||
" Return 1 if Vim could be executed.
|
||||
func RunVim(before, after, arguments)
|
||||
return RunVimPiped(a:before, a:after, a:arguments, '')
|
||||
endfunc
|
||||
|
||||
func RunVimPiped(before, after, arguments, pipecmd)
|
||||
if !filereadable('vimcmd')
|
||||
return 0
|
||||
endif
|
||||
let args = ''
|
||||
if len(a:before) > 0
|
||||
call writefile(a:before, 'Xbefore.vim')
|
||||
let args .= ' --cmd "so Xbefore.vim"'
|
||||
endif
|
||||
if len(a:after) > 0
|
||||
call writefile(a:after, 'Xafter.vim')
|
||||
let args .= ' -S Xafter.vim'
|
||||
endif
|
||||
|
||||
let cmd = readfile('vimcmd')[0]
|
||||
let cmd = substitute(cmd, '-u \f\+', '-u NONE', '')
|
||||
if cmd !~ '-u NONE'
|
||||
let cmd = cmd . ' -u NONE'
|
||||
endif
|
||||
|
||||
" With pipecmd we can't set VIMRUNTIME.
|
||||
if a:pipecmd != ''
|
||||
let cmd = substitute(cmd, 'VIMRUNTIME=.*VIMRUNTIME;', '', '')
|
||||
endif
|
||||
|
||||
exe "silent !" . a:pipecmd . cmd . args . ' ' . a:arguments
|
||||
|
||||
if len(a:before) > 0
|
||||
call delete('Xbefore.vim')
|
||||
endif
|
||||
if len(a:after) > 0
|
||||
call delete('Xafter.vim')
|
||||
endif
|
||||
return 1
|
||||
endfunc
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()",
|
||||
"matchadd()", "matchaddpos", "matcharg()", "matchdelete()", and "setmatches()".
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set encoding=utf8
|
||||
:" --- Check that "matcharg()" returns the correct group and pattern if a match
|
||||
:" --- is defined.
|
||||
:let @r = "*** Test 1: "
|
||||
:highlight MyGroup1 term=bold ctermbg=red guibg=red
|
||||
:highlight MyGroup2 term=italic ctermbg=green guibg=green
|
||||
:highlight MyGroup3 term=underline ctermbg=blue guibg=blue
|
||||
:match MyGroup1 /TODO/
|
||||
:2match MyGroup2 /FIXME/
|
||||
:3match MyGroup3 /XXX/
|
||||
:if matcharg(1) == ['MyGroup1', 'TODO'] && matcharg(2) == ['MyGroup2', 'FIXME'] && matcharg(3) == ['MyGroup3', 'XXX']
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:" --- Check that "matcharg()" returns an empty list if the argument is not 1,
|
||||
:" --- 2 or 3 (only 0 and 4 are tested).
|
||||
:let @r .= "*** Test 2: "
|
||||
:if matcharg(0) == [] && matcharg(4) == []
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:" --- Check that "matcharg()" returns ['', ''] if a match is not defined.
|
||||
:let @r .= "*** Test 3: "
|
||||
:match
|
||||
:2match
|
||||
:3match
|
||||
:if matcharg(1) == ['', ''] && matcharg(2) == ['', ''] && matcharg(3) == ['', '']
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:" --- Check that "matchadd()" and "getmatches()" agree on added matches and
|
||||
:" --- that default values apply.
|
||||
:let @r .= "*** Test 4: "
|
||||
:let m1 = matchadd("MyGroup1", "TODO")
|
||||
:let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
:let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
:if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 4}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 42, 'id': 5}, {'group': 'MyGroup3', 'pattern': 'XXX', 'priority': 60, 'id': 17}]
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:" --- Check that "matchdelete()" deletes the matches defined in the previous
|
||||
:" --- test correctly.
|
||||
:let @r .= "*** Test 5: "
|
||||
:call matchdelete(m1)
|
||||
:call matchdelete(m2)
|
||||
:call matchdelete(m3)
|
||||
:unlet m1
|
||||
:unlet m2
|
||||
:unlet m3
|
||||
:if getmatches() == []
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:" --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
|
||||
:let @r .= "*** Test 6: "
|
||||
:let m = matchadd("MyGroup1", "TODO")
|
||||
:let r1 = matchdelete(m)
|
||||
:let r2 = matchdelete(42)
|
||||
:if r1 == 0 && r2 == -1
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:unlet m
|
||||
:unlet r1
|
||||
:unlet r2
|
||||
:" --- Check that "clearmatches()" clears all matches defined by ":match" and
|
||||
:" --- "matchadd()".
|
||||
:let @r .= "*** Test 7: "
|
||||
:let m1 = matchadd("MyGroup1", "TODO")
|
||||
:let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
:let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
:match MyGroup1 /COFFEE/
|
||||
:2match MyGroup2 /HUMPPA/
|
||||
:3match MyGroup3 /VIM/
|
||||
:call clearmatches()
|
||||
:if getmatches() == []
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:unlet m1
|
||||
:unlet m2
|
||||
:unlet m3
|
||||
:" --- Check that "setmatches()" restores a list of matches saved by
|
||||
:" --- "getmatches()" without changes. (Matches with equal priority must also
|
||||
:" --- remain in the same order.)
|
||||
:let @r .= "*** Test 8: "
|
||||
:let m1 = matchadd("MyGroup1", "TODO")
|
||||
:let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
:let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
:match MyGroup1 /COFFEE/
|
||||
:2match MyGroup2 /HUMPPA/
|
||||
:3match MyGroup3 /VIM/
|
||||
:let ml = getmatches()
|
||||
:call clearmatches()
|
||||
:call setmatches(ml)
|
||||
:if getmatches() == ml
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:call clearmatches()
|
||||
:unlet m1
|
||||
:unlet m2
|
||||
:unlet m3
|
||||
:unlet ml
|
||||
:" --- Check that "setmatches()" will not add two matches with the same ID. The
|
||||
:" --- expected behaviour (for now) is to add the first match but not the
|
||||
:" --- second and to return 0 (even though it is a matter of debate whether
|
||||
:" --- this can be considered successful behaviour).
|
||||
:let @r .= "*** Test 9: "
|
||||
:let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
|
||||
:if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:call clearmatches()
|
||||
:unlet r1
|
||||
:" --- Check that "setmatches()" returns 0 if successful and otherwise -1.
|
||||
:" --- (A range of valid and invalid input values are tried out to generate the
|
||||
:" --- return values.)
|
||||
:let @r .= "*** Test 10: "
|
||||
:let rs1 = setmatches([])
|
||||
:let rs2 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}])
|
||||
:call clearmatches()
|
||||
:let rf1 = setmatches(0)
|
||||
:let rf2 = setmatches([0])
|
||||
:let rf3 = setmatches([{'wrong key': 'wrong value'}])
|
||||
:if rs1 == 0 && rs2 == 0 && rf1 == -1 && rf2 == -1 && rf3 == -1
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED\n"
|
||||
:endif
|
||||
:unlet rs1
|
||||
:unlet rs2
|
||||
:unlet rf1
|
||||
:unlet rf2
|
||||
:unlet rf3
|
||||
:" --- Check that "matchaddpos()" positions matches correctly
|
||||
:let @r .= "*** Test 11:\n"
|
||||
:set nolazyredraw
|
||||
:call setline(1, 'abcdefghijklmnopq')
|
||||
:call matchaddpos("MyGroup1", [[1, 5], [1, 8, 3]], 10, 3)
|
||||
:1
|
||||
:redraw!
|
||||
:let v1 = screenattr(1, 1)
|
||||
:let v5 = screenattr(1, 5)
|
||||
:let v6 = screenattr(1, 6)
|
||||
:let v8 = screenattr(1, 8)
|
||||
:let v10 = screenattr(1, 10)
|
||||
:let v11 = screenattr(1, 11)
|
||||
:let @r .= string(getmatches())."\n"
|
||||
:if v1 != v5 && v6 == v1 && v8 == v5 && v10 == v5 && v11 == v1
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED: " . v5 . "/" . v6 . "/" . v8 . "/" . v10 . "/" . v11 . "\n"
|
||||
:endif
|
||||
:call clearmatches()
|
||||
:"
|
||||
:call setline(1, 'abcdΣabcdef')
|
||||
:call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
|
||||
:1
|
||||
:redraw!
|
||||
:let v1 = screenattr(1, 1)
|
||||
:let v4 = screenattr(1, 4)
|
||||
:let v5 = screenattr(1, 5)
|
||||
:let v6 = screenattr(1, 6)
|
||||
:let v7 = screenattr(1, 7)
|
||||
:let v8 = screenattr(1, 8)
|
||||
:let v9 = screenattr(1, 9)
|
||||
:let v10 = screenattr(1, 10)
|
||||
:let @r .= string(getmatches())."\n"
|
||||
:if v1 != v4 && v5 == v4 && v6 == v1 && v7 == v1 && v8 == v4 && v9 == v4 && v10 == v1
|
||||
: let @r .= "OK\n"
|
||||
:else
|
||||
: let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
|
||||
:endif
|
||||
:" Check, that setmatches() can correctly restore the matches from matchaddpos()
|
||||
:call matchadd('MyGroup1', '\%2lmatchadd')
|
||||
:let m=getmatches()
|
||||
:call clearmatches()
|
||||
:call setmatches(m)
|
||||
:let @r .= string(getmatches())."\n"
|
||||
G"rp
|
||||
:/^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
Results of test63:
|
||||
@@ -1,17 +0,0 @@
|
||||
Results of test63:
|
||||
*** Test 1: OK
|
||||
*** Test 2: OK
|
||||
*** Test 3: OK
|
||||
*** Test 4: OK
|
||||
*** Test 5: OK
|
||||
*** Test 6: OK
|
||||
*** Test 7: OK
|
||||
*** Test 8: OK
|
||||
*** Test 9: OK
|
||||
*** Test 10: OK
|
||||
*** Test 11:
|
||||
[{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}]
|
||||
OK
|
||||
[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}]
|
||||
OK
|
||||
[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}]
|
||||
@@ -21,7 +21,7 @@ source test_join.vim
|
||||
source test_jumps.vim
|
||||
source test_lambda.vim
|
||||
source test_lispwords.vim
|
||||
source test_matchstrpos.vim
|
||||
source test_match.vim
|
||||
source test_menu.vim
|
||||
source test_messages.vim
|
||||
source test_partial.vim
|
||||
@@ -38,3 +38,4 @@ source test_timers.vim
|
||||
source test_true_false.vim
|
||||
source test_unlet.vim
|
||||
source test_window_cmd.vim
|
||||
source test_options.vim
|
||||
|
||||
@@ -125,12 +125,35 @@ func Test_getcompletion()
|
||||
let l = getcompletion('dark', 'highlight')
|
||||
call assert_equal([], l)
|
||||
|
||||
if has('cscope')
|
||||
let l = getcompletion('', 'cscope')
|
||||
let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
|
||||
call assert_equal(cmds, l)
|
||||
" using cmdline completion must not change the result
|
||||
call feedkeys(":cscope find \<c-d>\<c-c>", 'xt')
|
||||
let l = getcompletion('', 'cscope')
|
||||
call assert_equal(cmds, l)
|
||||
let keys = ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't']
|
||||
let l = getcompletion('find ', 'cscope')
|
||||
call assert_equal(keys, l)
|
||||
endif
|
||||
|
||||
if has('signs')
|
||||
sign define Testing linehl=Comment
|
||||
let l = getcompletion('', 'sign')
|
||||
let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace']
|
||||
call assert_equal(cmds, l)
|
||||
" using cmdline completion must not change the result
|
||||
call feedkeys(":sign list \<c-d>\<c-c>", 'xt')
|
||||
let l = getcompletion('', 'sign')
|
||||
call assert_equal(cmds, l)
|
||||
let l = getcompletion('list ', 'sign')
|
||||
call assert_equal(['Testing'], l)
|
||||
endif
|
||||
|
||||
" For others test if the name is recognized.
|
||||
let names = ['buffer', 'environment', 'file_in_path',
|
||||
\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
|
||||
if has('cscope')
|
||||
call add(names, 'cscope')
|
||||
endif
|
||||
if has('cmdline_hist')
|
||||
call add(names, 'history')
|
||||
endif
|
||||
@@ -140,9 +163,6 @@ func Test_getcompletion()
|
||||
if has('profile')
|
||||
call add(names, 'syntime')
|
||||
endif
|
||||
if has('signs')
|
||||
call add(names, 'sign')
|
||||
endif
|
||||
|
||||
set tags=Xtags
|
||||
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')
|
||||
|
||||
@@ -4,6 +4,256 @@ if !has('cscope') || !executable('cscope') || !has('quickfix')
|
||||
finish
|
||||
endif
|
||||
|
||||
func CscopeSetupOrClean(setup)
|
||||
if a:setup
|
||||
noa sp ../memfile_test.c
|
||||
saveas! Xmemfile_test.c
|
||||
call system('cscope -bk -fXcscope.out Xmemfile_test.c')
|
||||
call system('cscope -bk -fXcscope2.out Xmemfile_test.c')
|
||||
cscope add Xcscope.out
|
||||
set cscopequickfix=s-,g-,d-,c-,t-,e-,f-,i-,a-
|
||||
else
|
||||
cscope kill -1
|
||||
for file in ['Xcscope.out', 'Xcscope2.out', 'Xmemfile_test.c']
|
||||
call delete(file)
|
||||
endfo
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_cscopeWithCscopeConnections()
|
||||
call CscopeSetupOrClean(1)
|
||||
" Test 0: E568: duplicate cscope database not added
|
||||
try
|
||||
set nocscopeverbose
|
||||
cscope add Xcscope.out
|
||||
set cscopeverbose
|
||||
catch
|
||||
call assert_true(0)
|
||||
endtry
|
||||
call assert_fails('cscope add', 'E560')
|
||||
call assert_fails('cscope add Xcscope.out', 'E568')
|
||||
call assert_fails('cscope add doesnotexist.out', 'E563')
|
||||
|
||||
" Test 1: Find this C-Symbol
|
||||
for cmd in ['cs find s main', 'cs find 0 main']
|
||||
let a=execute(cmd)
|
||||
" Test 1.1 test where it moves the cursor
|
||||
call assert_equal('main(void)', getline('.'))
|
||||
" Test 1.2 test the output of the :cs command
|
||||
call assert_match('\n(1 of 1): <<main>> main(void )', a)
|
||||
endfor
|
||||
|
||||
" Test 2: Find this definition
|
||||
for cmd in ['cs find g test_mf_hash', 'cs find 1 test_mf_hash']
|
||||
exe cmd
|
||||
call assert_equal(['', '/*', ' * Test mf_hash_*() functions.', ' */', ' static void', 'test_mf_hash(void)', '{'], getline(line('.')-5, line('.')+1))
|
||||
endfor
|
||||
|
||||
" Test 3: Find functions called by this function
|
||||
for cmd in ['cs find d test_mf_hash', 'cs find 2 test_mf_hash']
|
||||
let a=execute(cmd)
|
||||
call assert_match('\n(1 of 42): <<mf_hash_init>> mf_hash_init(&ht);', a)
|
||||
call assert_equal(' mf_hash_init(&ht);', getline('.'))
|
||||
endfor
|
||||
|
||||
" Test 4: Find functions calling this function
|
||||
for cmd in ['cs find c test_mf_hash', 'cs find 3 test_mf_hash']
|
||||
let a=execute(cmd)
|
||||
call assert_match('\n(1 of 1): <<main>> test_mf_hash();', a)
|
||||
call assert_equal(' test_mf_hash();', getline('.'))
|
||||
endfor
|
||||
|
||||
" Test 5: Find this text string
|
||||
for cmd in ['cs find t Bram', 'cs find 4 Bram']
|
||||
let a=execute(cmd)
|
||||
call assert_match('(1 of 1): <<<unknown>>> \* VIM - Vi IMproved^Iby Bram Moolenaar', a)
|
||||
call assert_equal(' * VIM - Vi IMproved by Bram Moolenaar', getline('.'))
|
||||
endfor
|
||||
|
||||
" Test 6: Find this egrep pattern
|
||||
" test all matches returned by cscope
|
||||
for cmd in ['cs find e ^\#includ.', 'cs find 6 ^\#includ.']
|
||||
let a=execute(cmd)
|
||||
call assert_match('\n(1 of 3): <<<unknown>>> #include <assert.h>', a)
|
||||
call assert_equal('#include <assert.h>', getline('.'))
|
||||
cnext
|
||||
call assert_equal('#include "main.c"', getline('.'))
|
||||
cnext
|
||||
call assert_equal('#include "memfile.c"', getline('.'))
|
||||
call assert_fails('cnext', 'E553:')
|
||||
endfor
|
||||
|
||||
" Test 7: Find the same egrep pattern using lcscope this time.
|
||||
let a=execute('lcs find e ^\#includ.')
|
||||
call assert_match('\n(1 of 3): <<<unknown>>> #include <assert.h>', a)
|
||||
call assert_equal('#include <assert.h>', getline('.'))
|
||||
lnext
|
||||
call assert_equal('#include "main.c"', getline('.'))
|
||||
lnext
|
||||
call assert_equal('#include "memfile.c"', getline('.'))
|
||||
call assert_fails('lnext', 'E553:')
|
||||
|
||||
" Test 8: Find this file
|
||||
for cmd in ['cs find f Xmemfile_test.c', 'cs find 7 Xmemfile_test.c']
|
||||
enew
|
||||
let a=execute(cmd)
|
||||
call assert_match('\n"Xmemfile_test.c" 143L, 3137C', a)
|
||||
call assert_equal('Xmemfile_test.c', @%)
|
||||
endfor
|
||||
|
||||
" Test 9: Find files #including this file
|
||||
for cmd in ['cs find i assert.h', 'cs find 8 assert.h']
|
||||
enew
|
||||
let a=execute(cmd)
|
||||
call assert_equal(['','"Xmemfile_test.c" 143L, 3137C','(1 of 1): <<global>> #include <assert.h>'], split(a, '\n', 1))
|
||||
call assert_equal('#include <assert.h>', getline('.'))
|
||||
endfor
|
||||
|
||||
" Test 10: Invalid find command
|
||||
call assert_fails('cs find x', 'E560:')
|
||||
|
||||
" Test 11: Find places where this symbol is assigned a value
|
||||
" this needs a cscope >= 15.8
|
||||
" unfortunately, Travis has cscope version 15.7
|
||||
let cscope_version=systemlist('cscope --version')[0]
|
||||
let cs_version=str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?'))
|
||||
if cs_version >= 15.8
|
||||
for cmd in ['cs find a item', 'cs find 9 item']
|
||||
let a=execute(cmd)
|
||||
call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);'], split(a, '\n', 1))
|
||||
call assert_equal(' item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Test 12: leading whitespace is not removed for cscope find text
|
||||
let a=execute('cscope find t test_mf_hash')
|
||||
call assert_equal(['', '(1 of 1): <<<unknown>>> test_mf_hash();'], split(a, '\n', 1))
|
||||
call assert_equal(' test_mf_hash();', getline('.'))
|
||||
|
||||
" Test 13: test with scscope
|
||||
let a=execute('scs find t Bram')
|
||||
call assert_match('(1 of 1): <<<unknown>>> \* VIM - Vi IMproved^Iby Bram Moolenaar', a)
|
||||
call assert_equal(' * VIM - Vi IMproved by Bram Moolenaar', getline('.'))
|
||||
|
||||
" Test 14: cscope help
|
||||
for cmd in ['cs', 'cs help', 'cs xxx']
|
||||
let a=execute(cmd)
|
||||
call assert_match('^cscope commands:\n', a)
|
||||
call assert_match('\nadd :', a)
|
||||
call assert_match('\nfind :', a)
|
||||
call assert_match('\nhelp : Show this message', a)
|
||||
call assert_match('\nkill : Kill a connection', a)
|
||||
call assert_match('\nreset: Reinit all connections', a)
|
||||
call assert_match('\nshow : Show connections', a)
|
||||
endfor
|
||||
let a=execute('scscope help')
|
||||
call assert_match('This cscope command does not support splitting the window\.', a)
|
||||
|
||||
" Test 15: reset connections
|
||||
let a=execute('cscope reset')
|
||||
call assert_match('\nAdded cscope database.*Xcscope.out (#0)', a)
|
||||
call assert_match('\nAll cscope databases reset', a)
|
||||
|
||||
" Test 16: cscope show
|
||||
let a=execute('cscope show')
|
||||
call assert_match('\n 0 \d\+.*Xcscope.out\s*<none>', a)
|
||||
|
||||
" Test 17: cstag and 'csto' option
|
||||
set csto=0
|
||||
let a=execute('cstag TEST_COUNT')
|
||||
call assert_match('(1 of 1): <<TEST_COUNT>> #define TEST_COUNT 50000', a)
|
||||
call assert_equal('#define TEST_COUNT 50000', getline('.'))
|
||||
set csto=1
|
||||
let a=execute('cstag index_to_key')
|
||||
call assert_match('(1 of 1): <<index_to_key>> #define index_to_key(i) ((i) ^ 15167)', a)
|
||||
call assert_equal('#define index_to_key(i) ((i) ^ 15167)', getline('.'))
|
||||
call assert_fails('cstag xxx', 'E257:')
|
||||
call assert_fails('cstag', 'E562:')
|
||||
|
||||
" Test 18: 'cst' option
|
||||
set nocst
|
||||
call assert_fails('tag TEST_COUNT', 'E426:')
|
||||
set cst
|
||||
let a=execute('tag TEST_COUNT')
|
||||
call assert_match('(1 of 1): <<TEST_COUNT>> #define TEST_COUNT 50000', a)
|
||||
call assert_equal('#define TEST_COUNT 50000', getline('.'))
|
||||
let a=execute('tags')
|
||||
call assert_match('1 1 TEST_COUNT\s\+\d\+\s\+#define index_to_key', a)
|
||||
|
||||
" Test 19: this should trigger call to cs_print_tags()
|
||||
" Unclear how to check result though, we just exercise the code.
|
||||
set cst cscopequickfix=s0
|
||||
call feedkeys(":cs find s main\<CR>", 't')
|
||||
|
||||
" Test 20: cscope kill
|
||||
call assert_fails('cscope kill 2', 'E261:')
|
||||
call assert_fails('cscope kill xxx', 'E261:')
|
||||
|
||||
let a=execute('cscope kill 0')
|
||||
call assert_match('cscope connection 0 closed', a)
|
||||
|
||||
cscope add Xcscope.out
|
||||
let a=execute('cscope kill Xcscope.out')
|
||||
call assert_match('cscope connection Xcscope.out closed', a)
|
||||
|
||||
cscope add Xcscope.out .
|
||||
let a=execute('cscope kill -1')
|
||||
call assert_match('cscope connection .*Xcscope.out closed', a)
|
||||
let a=execute('cscope kill -1')
|
||||
call assert_equal('', a)
|
||||
|
||||
" Test 21: 'csprg' option
|
||||
call assert_equal('cscope', &csprg)
|
||||
set csprg=doesnotexist
|
||||
call assert_fails('cscope add Xcscope2.out', 'E609:')
|
||||
set csprg=cscope
|
||||
|
||||
" Test 22: multiple cscope connections
|
||||
cscope add Xcscope.out
|
||||
cscope add Xcscope2.out . -C
|
||||
let a=execute('cscope show')
|
||||
call assert_match('\n 0 \d\+.*Xcscope.out\s*<none>', a)
|
||||
call assert_match('\n 1 \d\+.*Xcscope2.out\s*\.', a)
|
||||
|
||||
" Test 23: test Ex command line completion
|
||||
call feedkeys(":cs \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"cs add find help kill reset show', @:)
|
||||
|
||||
call feedkeys(":scs \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"scs find', @:)
|
||||
|
||||
call feedkeys(":cs find \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"cs find a c d e f g i s t', @:)
|
||||
|
||||
call feedkeys(":cs kill \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"cs kill -1 0 1', @:)
|
||||
|
||||
call feedkeys(":cs add Xcscope\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"cs add Xcscope.out Xcscope2.out', @:)
|
||||
|
||||
" Test 24: cscope_connection()
|
||||
call assert_equal(cscope_connection(), 1)
|
||||
call assert_equal(cscope_connection(0, 'out'), 1)
|
||||
call assert_equal(cscope_connection(0, 'xxx'), 1)
|
||||
call assert_equal(cscope_connection(1, 'out'), 1)
|
||||
call assert_equal(cscope_connection(1, 'xxx'), 0)
|
||||
call assert_equal(cscope_connection(2, 'out'), 0)
|
||||
call assert_equal(cscope_connection(3, 'xxx', '..'), 0)
|
||||
call assert_equal(cscope_connection(3, 'out', 'xxx'), 0)
|
||||
call assert_equal(cscope_connection(3, 'out', '.'), 1)
|
||||
call assert_equal(cscope_connection(4, 'out', '.'), 0)
|
||||
|
||||
" CleanUp
|
||||
call CscopeSetupOrClean(0)
|
||||
|
||||
endfunc
|
||||
|
||||
func Test_cscopequickfix()
|
||||
set cscopequickfix=s-,g-,d+,c-,t+,e-,f0,i-,a-
|
||||
call assert_equal('s-,g-,d+,c-,t+,e-,f0,i-,a-', &cscopequickfix)
|
||||
@@ -14,127 +264,13 @@ func Test_cscopequickfix()
|
||||
call assert_fails('set cscopequickfix=s-a', 'E474:')
|
||||
endfunc
|
||||
|
||||
func CscopeSetupOrClean(setup)
|
||||
if a:setup
|
||||
noa sp ../memfile_test.c
|
||||
saveas! Xmemfile_test.c
|
||||
call system('cscope -bk -fXcscope.out Xmemfile_test.c')
|
||||
cscope add Xcscope.out
|
||||
set cscopequickfix=s-,g-,d-,c-,t-,e-,f-,i-,a-
|
||||
else
|
||||
cscope kill -1
|
||||
for file in ['Xcscope.out', 'Xmemfile_test.c']
|
||||
call delete(file)
|
||||
endfor
|
||||
endif
|
||||
func Test_withoutCscopeConnection()
|
||||
call assert_equal(cscope_connection(), 0)
|
||||
|
||||
call assert_fails('cscope find s main', 'E567:')
|
||||
let a=execute('cscope show')
|
||||
call assert_match('no cscope connections', a)
|
||||
endfunc
|
||||
|
||||
func Test_cscope1()
|
||||
call CscopeSetupOrClean(1)
|
||||
" Test 0: E568: duplicate cscope database not added
|
||||
try
|
||||
set nocscopeverbose
|
||||
cscope add Xcscope.out
|
||||
set cscopeverbose
|
||||
catch
|
||||
call assert_true(0)
|
||||
endtry
|
||||
call assert_fails('cscope add Xcscope.out', 'E568')
|
||||
" Test 1: Find this C-Symbol
|
||||
let a=execute('cscope find s main')
|
||||
" Test 1.1 test where it moves the cursor
|
||||
call assert_equal('main(void)', getline('.'))
|
||||
" Test 1.2 test the output of the :cs command
|
||||
call assert_match('\n(1 of 1): <<main>> main(void )', a)
|
||||
|
||||
" Test 2: Find this definition
|
||||
cscope find g test_mf_hash
|
||||
call assert_equal(['', '/*', ' * Test mf_hash_*() functions.', ' */', ' static void', 'test_mf_hash(void)', '{'], getline(line('.')-5, line('.')+1))
|
||||
|
||||
" Test 3: Find functions called by this function
|
||||
let a=execute('cscope find d test_mf_hash')
|
||||
call assert_match('\n(1 of 42): <<mf_hash_init>> mf_hash_init(&ht);', a)
|
||||
call assert_equal(' mf_hash_init(&ht);', getline('.'))
|
||||
|
||||
" Test 4: Find functions calling this function
|
||||
let a=execute('cscope find c test_mf_hash')
|
||||
call assert_match('\n(1 of 1): <<main>> test_mf_hash();', a)
|
||||
call assert_equal(' test_mf_hash();', getline('.'))
|
||||
|
||||
" Test 5: Find this text string
|
||||
let a=execute('cscope find t Bram')
|
||||
call assert_match('(1 of 1): <<<unknown>>> \* VIM - Vi IMproved^Iby Bram Moolenaar', a)
|
||||
call assert_equal(' * VIM - Vi IMproved by Bram Moolenaar', getline('.'))
|
||||
|
||||
" Test 6: Find this egrep pattern
|
||||
" test all matches returned by cscope
|
||||
let a=execute('cscope find e ^\#includ.')
|
||||
call assert_match('\n(1 of 3): <<<unknown>>> #include <assert.h>', a)
|
||||
call assert_equal('#include <assert.h>', getline('.'))
|
||||
cnext
|
||||
call assert_equal('#include "main.c"', getline('.'))
|
||||
cnext
|
||||
call assert_equal('#include "memfile.c"', getline('.'))
|
||||
call assert_fails('cnext', 'E553')
|
||||
|
||||
" Test 7: Find this file
|
||||
enew
|
||||
let a=execute('cscope find f Xmemfile_test.c')
|
||||
call assert_match('\n"Xmemfile_test.c" 143L, 3137C', a)
|
||||
call assert_equal('Xmemfile_test.c', @%)
|
||||
|
||||
" Test 8: Find files #including this file
|
||||
enew
|
||||
let a=execute('cscope find i assert.h')
|
||||
call assert_equal(['','"Xmemfile_test.c" 143L, 3137C','(1 of 1): <<global>> #include <assert.h>'], split(a, '\n', 1))
|
||||
call assert_equal('#include <assert.h>', getline('.'))
|
||||
|
||||
" Test 9: Find places where this symbol is assigned a value
|
||||
" this needs a cscope >= 15.8
|
||||
" unfortunatly, Travis has cscope version 15.7
|
||||
let cscope_version=systemlist('cscope --version')[0]
|
||||
let cs_version=str2float(matchstr(cscope_version, '\d\+\(\.\d\+\)\?'))
|
||||
if cs_version >= 15.8
|
||||
let a=execute('cscope find a item')
|
||||
call assert_equal(['', '(1 of 4): <<test_mf_hash>> item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);'], split(a, '\n', 1))
|
||||
call assert_equal(' item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
cnext
|
||||
call assert_equal(' item = mf_hash_find(&ht, key);', getline('.'))
|
||||
endif
|
||||
|
||||
" Test 10: leading whitespace is not removed for cscope find text
|
||||
let a=execute('cscope find t test_mf_hash')
|
||||
call assert_equal(['', '(1 of 1): <<<unknown>>> test_mf_hash();'], split(a, '\n', 1))
|
||||
call assert_equal(' test_mf_hash();', getline('.'))
|
||||
|
||||
" Test 11: cscope help
|
||||
let a=execute('cscope help')
|
||||
call assert_match('^cscope commands:\n', a)
|
||||
call assert_match('\nadd :', a)
|
||||
call assert_match('\nfind :', a)
|
||||
call assert_match('\nhelp : Show this message', a)
|
||||
call assert_match('\nkill : Kill a connection', a)
|
||||
call assert_match('\nreset: Reinit all connections', a)
|
||||
call assert_match('\nshow : Show connections', a)
|
||||
|
||||
" Test 12: reset connections
|
||||
let a=execute('cscope reset')
|
||||
call assert_match('\nAdded cscope database.*Xcscope.out (#0)', a)
|
||||
call assert_match('\nAll cscope databases reset', a)
|
||||
|
||||
" Test 13: cscope show
|
||||
let a=execute('cscope show')
|
||||
call assert_match('\n 0 \d\+.*Xcscope.out\s*<none>', a)
|
||||
|
||||
" Test 14: 'csprg' option
|
||||
call assert_equal('cscope', &csprg)
|
||||
|
||||
" CleanUp
|
||||
call CscopeSetupOrClean(0)
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -194,3 +194,16 @@ func Test_funcref()
|
||||
let OneByRef = funcref('One')
|
||||
call assert_equal(2, OneByRef())
|
||||
endfunc
|
||||
|
||||
func Test_setmatches()
|
||||
hi def link 1 Comment
|
||||
hi def link 2 PreProc
|
||||
let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4}]
|
||||
let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4}]
|
||||
if has('conceal')
|
||||
let set[0]['conceal'] = 5
|
||||
let exp[0]['conceal'] = '5'
|
||||
endif
|
||||
call setmatches(set)
|
||||
call assert_equal(exp, getmatches())
|
||||
endfunc
|
||||
|
||||
@@ -2,9 +2,25 @@
|
||||
|
||||
func Test_invalid()
|
||||
call assert_fails('call glob2regpat(1.33)', 'E806:')
|
||||
call assert_fails('call glob2regpat("}")', 'E219:')
|
||||
call assert_fails('call glob2regpat("{")', 'E220:')
|
||||
endfunc
|
||||
|
||||
func Test_valid()
|
||||
call assert_equal('^foo\.', glob2regpat('foo.*'))
|
||||
call assert_equal('^foo.$', glob2regpat('foo?'))
|
||||
call assert_equal('\.vim$', glob2regpat('*.vim'))
|
||||
call assert_equal('^[abc]$', glob2regpat('[abc]'))
|
||||
call assert_equal('^foo bar$', glob2regpat('foo\ bar'))
|
||||
call assert_equal('^foo,bar$', glob2regpat('foo,bar'))
|
||||
call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}'))
|
||||
call assert_equal('.*', glob2regpat('**'))
|
||||
|
||||
if has('unix')
|
||||
call assert_equal('^foo?$', glob2regpat('foo\?'))
|
||||
call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
|
||||
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
|
||||
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
|
||||
" todo: Windows
|
||||
endif
|
||||
endfunc
|
||||
|
||||
@@ -21,8 +21,8 @@ endfunc
|
||||
|
||||
func Test_shell_command()
|
||||
new
|
||||
r !echo 'hello'
|
||||
call assert_equal('hello', getline(2))
|
||||
r !echo hello
|
||||
call assert_equal('hello', substitute(getline(2), '\W', '', 'g'))
|
||||
bwipe!
|
||||
call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y \d\+') >= 0)
|
||||
endfunc
|
||||
|
||||
19
src/testdir/test_job_fails.vim
Normal file
19
src/testdir/test_job_fails.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" This test is in a separate file, because it usually causes reports for memory
|
||||
" leaks under valgrind. That is because when fork/exec fails memory is not
|
||||
" freed. Since the process exists right away it's not a real leak.
|
||||
|
||||
source shared.vim
|
||||
|
||||
func Test_job_start_fails()
|
||||
if has('job')
|
||||
let g:job = job_start('axdfxsdf')
|
||||
if has('unix')
|
||||
call WaitFor('job_status(g:job) == "dead"')
|
||||
call assert_equal('dead', job_status(g:job))
|
||||
else
|
||||
call WaitFor('job_status(g:job) == "fail"')
|
||||
call assert_equal('fail', job_status(g:job))
|
||||
endif
|
||||
unlet g:job
|
||||
endif
|
||||
endfunc
|
||||
165
src/testdir/test_match.vim
Normal file
165
src/testdir/test_match.vim
Normal file
@@ -0,0 +1,165 @@
|
||||
" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
|
||||
" matchaddpos(), matcharg(), matchdelete(), matchstrpos() and setmatches().
|
||||
|
||||
function Test_matcharg()
|
||||
highlight MyGroup1 term=bold ctermbg=red guibg=red
|
||||
highlight MyGroup2 term=italic ctermbg=green guibg=green
|
||||
highlight MyGroup3 term=underline ctermbg=blue guibg=blue
|
||||
|
||||
" --- Check that "matcharg()" returns the correct group and pattern if a match
|
||||
" --- is defined.
|
||||
match MyGroup1 /TODO/
|
||||
2match MyGroup2 /FIXME/
|
||||
3match MyGroup3 /XXX/
|
||||
call assert_equal(['MyGroup1', 'TODO'], matcharg(1))
|
||||
call assert_equal(['MyGroup2', 'FIXME'], matcharg(2))
|
||||
call assert_equal(['MyGroup3', 'XXX'], matcharg(3))
|
||||
|
||||
" --- Check that "matcharg()" returns an empty list if the argument is not 1,
|
||||
" --- 2 or 3 (only 0 and 4 are tested).
|
||||
call assert_equal([], matcharg(0))
|
||||
call assert_equal([], matcharg(4))
|
||||
|
||||
" --- Check that "matcharg()" returns ['', ''] if a match is not defined.
|
||||
match
|
||||
2match
|
||||
3match
|
||||
call assert_equal(['', ''], matcharg(1))
|
||||
call assert_equal(['', ''], matcharg(2))
|
||||
call assert_equal(['', ''], matcharg(3))
|
||||
|
||||
" --- Check that "matchadd()" and "getmatches()" agree on added matches and
|
||||
" --- that default values apply.
|
||||
let m1 = matchadd("MyGroup1", "TODO")
|
||||
let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
let ans = [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 4},
|
||||
\ {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 42, 'id': 5},
|
||||
\ {'group': 'MyGroup3', 'pattern': 'XXX', 'priority': 60, 'id': 17}]
|
||||
call assert_equal(ans, getmatches())
|
||||
|
||||
" --- Check that "matchdelete()" deletes the matches defined in the previous
|
||||
" --- test correctly.
|
||||
call matchdelete(m1)
|
||||
call matchdelete(m2)
|
||||
call matchdelete(m3)
|
||||
call assert_equal([], getmatches())
|
||||
|
||||
" --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
|
||||
let m = matchadd("MyGroup1", "TODO")
|
||||
call assert_equal(0, matchdelete(m))
|
||||
call assert_fails('call matchdelete(42)', 'E803:')
|
||||
|
||||
" --- Check that "clearmatches()" clears all matches defined by ":match" and
|
||||
" --- "matchadd()".
|
||||
let m1 = matchadd("MyGroup1", "TODO")
|
||||
let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
match MyGroup1 /COFFEE/
|
||||
2match MyGroup2 /HUMPPA/
|
||||
3match MyGroup3 /VIM/
|
||||
call clearmatches()
|
||||
call assert_equal([], getmatches())
|
||||
|
||||
" --- Check that "setmatches()" restores a list of matches saved by
|
||||
" --- "getmatches()" without changes. (Matches with equal priority must also
|
||||
" --- remain in the same order.)
|
||||
let m1 = matchadd("MyGroup1", "TODO")
|
||||
let m2 = matchadd("MyGroup2", "FIXME", 42)
|
||||
let m3 = matchadd("MyGroup3", "XXX", 60, 17)
|
||||
match MyGroup1 /COFFEE/
|
||||
2match MyGroup2 /HUMPPA/
|
||||
3match MyGroup3 /VIM/
|
||||
let ml = getmatches()
|
||||
call clearmatches()
|
||||
call setmatches(ml)
|
||||
call assert_equal(ml, getmatches())
|
||||
call clearmatches()
|
||||
|
||||
" --- Check that "setmatches()" will not add two matches with the same ID. The
|
||||
" --- expected behaviour (for now) is to add the first match but not the
|
||||
" --- second and to return 0 (even though it is a matter of debate whether
|
||||
" --- this can be considered successful behaviour).
|
||||
let data = [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1},
|
||||
\ {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}]
|
||||
call assert_fails('call setmatches(data)', 'E801:')
|
||||
call assert_equal([data[0]], getmatches())
|
||||
call clearmatches()
|
||||
|
||||
" --- Check that "setmatches()" returns 0 if successful and otherwise -1.
|
||||
" --- (A range of valid and invalid input values are tried out to generate the
|
||||
" --- return values.)
|
||||
call assert_equal(0, setmatches([]))
|
||||
call assert_equal(0, setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}]))
|
||||
call clearmatches()
|
||||
call assert_fails('call setmatches(0)', 'E714:')
|
||||
call assert_fails('call setmatches([0])', 'E474:')
|
||||
call assert_fails("call setmatches([{'wrong key': 'wrong value'}])", 'E474:')
|
||||
|
||||
call setline(1, 'abcdefghijklmnopq')
|
||||
call matchaddpos("MyGroup1", [[1, 5], [1, 8, 3]], 10, 3)
|
||||
1
|
||||
redraw!
|
||||
let v1 = screenattr(1, 1)
|
||||
let v5 = screenattr(1, 5)
|
||||
let v6 = screenattr(1, 6)
|
||||
let v8 = screenattr(1, 8)
|
||||
let v10 = screenattr(1, 10)
|
||||
let v11 = screenattr(1, 11)
|
||||
call assert_notequal(v1, v5)
|
||||
call assert_equal(v6, v1)
|
||||
call assert_equal(v8, v5)
|
||||
call assert_equal(v10, v5)
|
||||
call assert_equal(v11, v1)
|
||||
call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches())
|
||||
call clearmatches()
|
||||
|
||||
"
|
||||
if has('multi_byte')
|
||||
call setline(1, 'abcdΣabcdef')
|
||||
call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
|
||||
1
|
||||
redraw!
|
||||
let v1 = screenattr(1, 1)
|
||||
let v4 = screenattr(1, 4)
|
||||
let v5 = screenattr(1, 5)
|
||||
let v6 = screenattr(1, 6)
|
||||
let v7 = screenattr(1, 7)
|
||||
let v8 = screenattr(1, 8)
|
||||
let v9 = screenattr(1, 9)
|
||||
let v10 = screenattr(1, 10)
|
||||
call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches())
|
||||
call assert_notequal(v1, v4)
|
||||
call assert_equal(v5, v4)
|
||||
call assert_equal(v6, v1)
|
||||
call assert_equal(v7, v1)
|
||||
call assert_equal(v8, v4)
|
||||
call assert_equal(v9, v4)
|
||||
call assert_equal(v10, v1)
|
||||
|
||||
" Check, that setmatches() can correctly restore the matches from matchaddpos()
|
||||
call matchadd('MyGroup1', '\%2lmatchadd')
|
||||
let m=getmatches()
|
||||
call clearmatches()
|
||||
call setmatches(m)
|
||||
call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches())
|
||||
endif
|
||||
|
||||
highlight MyGroup1 NONE
|
||||
highlight MyGroup2 NONE
|
||||
highlight MyGroup3 NONE
|
||||
endfunc
|
||||
|
||||
func Test_matchstrpos()
|
||||
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing'))
|
||||
|
||||
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing', 2))
|
||||
|
||||
call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 5))
|
||||
|
||||
call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing'))
|
||||
|
||||
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
|
||||
endfunc
|
||||
|
||||
" vim: et ts=2 sw=2
|
||||
@@ -1,13 +0,0 @@
|
||||
" Test matchstrpos
|
||||
|
||||
func Test_matchstrpos()
|
||||
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing'))
|
||||
|
||||
call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing', 2))
|
||||
|
||||
call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 5))
|
||||
|
||||
call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing'))
|
||||
|
||||
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
|
||||
endfunc
|
||||
@@ -1,23 +0,0 @@
|
||||
Test for ":options".
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:let caught = 'ok'
|
||||
:try
|
||||
:options
|
||||
:catch
|
||||
:let caught = v:throwpoint . "\n" . v:exception
|
||||
:endtry
|
||||
:buf 1
|
||||
:$put =caught
|
||||
:"
|
||||
:" Test that changing 'path' keeps two commas.
|
||||
:set path=foo,,bar
|
||||
:set path-=bar
|
||||
:set path+=bar
|
||||
:$put =&path
|
||||
:/^result/,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
result
|
||||
@@ -1,3 +0,0 @@
|
||||
result
|
||||
ok
|
||||
foo,,bar
|
||||
40
src/testdir/test_options.vim
Normal file
40
src/testdir/test_options.vim
Normal file
@@ -0,0 +1,40 @@
|
||||
" Test for options
|
||||
|
||||
function! Test_whichwrap()
|
||||
set whichwrap=b,s
|
||||
call assert_equal('b,s', &whichwrap)
|
||||
|
||||
set whichwrap+=h,l
|
||||
call assert_equal('b,s,h,l', &whichwrap)
|
||||
|
||||
set whichwrap+=h,l
|
||||
call assert_equal('b,s,h,l', &whichwrap)
|
||||
|
||||
set whichwrap+=h,l
|
||||
call assert_equal('b,s,h,l', &whichwrap)
|
||||
|
||||
set whichwrap&
|
||||
endfunction
|
||||
|
||||
function! Test_options()
|
||||
let caught = 'ok'
|
||||
try
|
||||
options
|
||||
catch
|
||||
let caught = v:throwpoint . "\n" . v:exception
|
||||
endtry
|
||||
call assert_equal('ok', caught)
|
||||
|
||||
" close option-window
|
||||
close
|
||||
endfunction
|
||||
|
||||
function! Test_path_keep_commas()
|
||||
" Test that changing 'path' keeps two commas.
|
||||
set path=foo,,bar
|
||||
set path-=bar
|
||||
set path+=bar
|
||||
call assert_equal('foo,,bar', &path)
|
||||
|
||||
set path&
|
||||
endfunction
|
||||
@@ -1,27 +1,5 @@
|
||||
" Test binding arguments to a Funcref.
|
||||
|
||||
" NOTE: This function may cause memory leaks to be reported.
|
||||
" That is because when fork/exec fails memory is not freed. Since the process
|
||||
" exists right away it's not a real leak.
|
||||
func Test_job_start_fails()
|
||||
if has('job')
|
||||
let job = job_start('axdfxsdf')
|
||||
for i in range(100)
|
||||
let status = job_status(job)
|
||||
if status == 'dead' || status == 'fail'
|
||||
break
|
||||
endif
|
||||
sleep 10m
|
||||
endfor
|
||||
if has('unix')
|
||||
call assert_equal('dead', job_status(job))
|
||||
else
|
||||
call assert_equal('fail', job_status(job))
|
||||
endif
|
||||
unlet job
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func MyFunc(arg1, arg2, arg3)
|
||||
return a:arg1 . '/' . a:arg2 . '/' . a:arg3
|
||||
endfunc
|
||||
|
||||
@@ -170,11 +170,12 @@ func! Test_popup_complete()
|
||||
|
||||
" Insert match immediately, if there is only one match
|
||||
" <c-e> Should select a character from the line below
|
||||
call append(1, ["December2015"])
|
||||
:1
|
||||
call feedkeys("aD\<f5>\<C-E>\<C-E>\<C-E>\<C-E>\<enter>\<esc>", 'tx')
|
||||
call assert_equal(["December2015", "", "December2015"], getline(1,3))
|
||||
%d
|
||||
" TODO: test disabled because the code change has been reverted.
|
||||
" call append(1, ["December2015"])
|
||||
" :1
|
||||
" call feedkeys("aD\<f5>\<C-E>\<C-E>\<C-E>\<C-E>\<enter>\<esc>", 'tx')
|
||||
" call assert_equal(["December2015", "", "December2015"], getline(1,3))
|
||||
" %d
|
||||
|
||||
" use menuone for 'completeopt'
|
||||
" Since for the first <c-y> the menu is still shown, will only select
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
Tests for signs
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if !has("signs")
|
||||
: e! test.ok
|
||||
: wq! test.out
|
||||
:endif
|
||||
:"
|
||||
:sign define JumpSign text=x
|
||||
:exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('')
|
||||
:" Split the window to the bottom to verify :sign-jump will stay in the current
|
||||
:" window if the buffer is displayed there
|
||||
:bot split
|
||||
:exe 'sign jump 42 buffer=' . bufnr('')
|
||||
:call append(line('$'), winnr())
|
||||
:$-1,$w! test.out
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
2
|
||||
106
src/testdir/test_signs.vim
Normal file
106
src/testdir/test_signs.vim
Normal file
@@ -0,0 +1,106 @@
|
||||
" Test for signs
|
||||
|
||||
if !has('signs')
|
||||
finish
|
||||
endif
|
||||
|
||||
func Test_sign()
|
||||
new
|
||||
call setline(1, ['a', 'b', 'c', 'd'])
|
||||
|
||||
sign define Sign1 text=x
|
||||
sign define Sign2 text=y
|
||||
|
||||
" Test listing signs.
|
||||
let a=execute('sign list')
|
||||
call assert_equal("\nsign Sign1 text=x \nsign Sign2 text=y ", a)
|
||||
|
||||
let a=execute('sign list Sign1')
|
||||
call assert_equal("\nsign Sign1 text=x ", a)
|
||||
|
||||
" Place the sign at line 3,then check that we can jump to it.
|
||||
exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')
|
||||
1
|
||||
exe 'sign jump 42 buffer=' . bufnr('')
|
||||
call assert_equal('c', getline('.'))
|
||||
|
||||
" Can't change sign.
|
||||
call assert_fails("exe 'sign place 43 name=Sign1 buffer=' . bufnr('')", 'E885:')
|
||||
|
||||
let a=execute('sign place')
|
||||
call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n line=3 id=42 name=Sign1\n", a)
|
||||
|
||||
" Unplace the sign and try jumping to it again should now fail.
|
||||
sign unplace 42
|
||||
1
|
||||
call assert_fails("exe 'sign jump 42 buffer=' . bufnr('')", 'E157:')
|
||||
call assert_equal('a', getline('.'))
|
||||
|
||||
" Unplace sign on current line.
|
||||
exe 'sign place 43 line=4 name=Sign2 buffer=' . bufnr('')
|
||||
4
|
||||
sign unplace
|
||||
let a=execute('sign place')
|
||||
call assert_equal("\n--- Signs ---\n", a)
|
||||
|
||||
" Try again to unplace sign on current line, it should fail this time.
|
||||
call assert_fails('sign unplace', 'E159:')
|
||||
|
||||
" Unplace all signs.
|
||||
exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')
|
||||
sign unplace *
|
||||
let a=execute('sign place')
|
||||
call assert_equal("\n--- Signs ---\n", a)
|
||||
|
||||
" After undefining the sign, we should no longer be able to place it.
|
||||
sign undefine Sign1
|
||||
sign undefine Sign2
|
||||
call assert_fails("exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')", 'E155:')
|
||||
|
||||
endfunc
|
||||
|
||||
func Test_sign_completion()
|
||||
sign define Sign1 text=x
|
||||
sign define Sign2 text=y
|
||||
|
||||
call feedkeys(":sign \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign define jump list place undefine unplace', @:)
|
||||
|
||||
call feedkeys(":sign define Sign \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign define Sign icon= linehl= text= texthl=', @:)
|
||||
|
||||
call feedkeys(":sign define Sign linehl=Spell\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign define Sign linehl=SpellBad SpellCap SpellLocal SpellRare', @:)
|
||||
|
||||
call feedkeys(":sign undefine \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign undefine Sign1 Sign2', @:)
|
||||
|
||||
call feedkeys(":sign place 1 \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign place 1 buffer= file= line= name=', @:)
|
||||
|
||||
call feedkeys(":sign place 1 name=\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign place 1 name=Sign1 Sign2', @:)
|
||||
|
||||
call feedkeys(":sign unplace 1 \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign unplace 1 buffer= file=', @:)
|
||||
|
||||
call feedkeys(":sign list \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign list Sign1 Sign2', @:)
|
||||
|
||||
call feedkeys(":sign jump 1 \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"sign jump 1 buffer= file=', @:)
|
||||
|
||||
sign undefine Sign1
|
||||
sign undefine Sign2
|
||||
|
||||
endfunc
|
||||
|
||||
func Test_sign_invalid_commands()
|
||||
call assert_fails('sign', 'E471:')
|
||||
call assert_fails('sign xxx', 'E160:')
|
||||
call assert_fails('sign define', 'E156:')
|
||||
call assert_fails('sign undefine', 'E156:')
|
||||
call assert_fails('sign list xxx', 'E155:')
|
||||
call assert_fails('sign place 1 buffer=', 'E158:')
|
||||
call assert_fails('sign define Sign2 text=', 'E239:')
|
||||
endfunc
|
||||
@@ -1,8 +1,184 @@
|
||||
" Check that loading startup.vim works.
|
||||
" Tests for startup.
|
||||
|
||||
source shared.vim
|
||||
|
||||
" Check that loading startup.vim works.
|
||||
func Test_startup_script()
|
||||
set compatible
|
||||
source $VIMRUNTIME/defaults.vim
|
||||
|
||||
call assert_equal(0, &compatible)
|
||||
endfunc
|
||||
|
||||
" Verify the order in which plugins are loaded:
|
||||
" 1. plugins in non-after directories
|
||||
" 2. packages
|
||||
" 3. plugins in after directories
|
||||
func Test_after_comes_later()
|
||||
if !has('packages')
|
||||
return
|
||||
endif
|
||||
let before = [
|
||||
\ 'set nocp viminfo+=nviminfo',
|
||||
\ 'set guioptions+=M',
|
||||
\ 'let $HOME = "/does/not/exist"',
|
||||
\ 'set loadplugins',
|
||||
\ 'set rtp=Xhere,Xafter',
|
||||
\ 'set packpath=Xhere,Xafter',
|
||||
\ 'set nomore',
|
||||
\ ]
|
||||
let after = [
|
||||
\ 'redir! > Xtestout',
|
||||
\ 'scriptnames',
|
||||
\ 'redir END',
|
||||
\ 'quit',
|
||||
\ ]
|
||||
call mkdir('Xhere/plugin', 'p')
|
||||
call writefile(['let done = 1'], 'Xhere/plugin/here.vim')
|
||||
call mkdir('Xhere/pack/foo/start/foobar/plugin', 'p')
|
||||
call writefile(['let done = 1'], 'Xhere/pack/foo/start/foobar/plugin/foo.vim')
|
||||
|
||||
call mkdir('Xafter/plugin', 'p')
|
||||
call writefile(['let done = 1'], 'Xafter/plugin/later.vim')
|
||||
|
||||
if RunVim(before, after, '')
|
||||
|
||||
let lines = readfile('Xtestout')
|
||||
let expected = ['Xbefore.vim', 'here.vim', 'foo.vim', 'later.vim', 'Xafter.vim']
|
||||
let found = []
|
||||
for line in lines
|
||||
for one in expected
|
||||
if line =~ one
|
||||
call add(found, one)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
call assert_equal(expected, found)
|
||||
endif
|
||||
|
||||
call delete('Xtestout')
|
||||
call delete('Xhere', 'rf')
|
||||
call delete('Xafter', 'rf')
|
||||
endfunc
|
||||
|
||||
func Test_help_arg()
|
||||
if !has('unix') && has('gui')
|
||||
" this doesn't work with gvim on MS-Windows
|
||||
return
|
||||
endif
|
||||
if RunVim([], [], '--help >Xtestout')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_true(len(lines) > 20)
|
||||
call assert_match('Vi IMproved', lines[0])
|
||||
|
||||
" check if couple of lines are there
|
||||
let found = 0
|
||||
for line in lines
|
||||
if line =~ '-R.*Readonly mode'
|
||||
let found += 1
|
||||
endif
|
||||
if line =~ '--version'
|
||||
let found += 1
|
||||
endif
|
||||
endfor
|
||||
call assert_equal(2, found)
|
||||
endif
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
func Test_compatible_args()
|
||||
let after = [
|
||||
\ 'call writefile([string(&compatible)], "Xtestout")',
|
||||
\ 'set viminfo+=nviminfo',
|
||||
\ 'quit',
|
||||
\ ]
|
||||
if RunVim([], after, '-C')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal('1', lines[0])
|
||||
endif
|
||||
|
||||
if RunVim([], after, '-N')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal('0', lines[0])
|
||||
endif
|
||||
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
func Test_file_args()
|
||||
let after = [
|
||||
\ 'call writefile(argv(), "Xtestout")',
|
||||
\ 'qall',
|
||||
\ ]
|
||||
if RunVim([], after, '')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal(0, len(lines))
|
||||
endif
|
||||
|
||||
if RunVim([], after, 'one')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal(1, len(lines))
|
||||
call assert_equal('one', lines[0])
|
||||
endif
|
||||
|
||||
if RunVim([], after, 'one two three')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal(3, len(lines))
|
||||
call assert_equal('one', lines[0])
|
||||
call assert_equal('two', lines[1])
|
||||
call assert_equal('three', lines[2])
|
||||
endif
|
||||
|
||||
if RunVim([], after, 'one -c echo two')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal(2, len(lines))
|
||||
call assert_equal('one', lines[0])
|
||||
call assert_equal('two', lines[1])
|
||||
endif
|
||||
|
||||
if RunVim([], after, 'one -- -c echo two')
|
||||
let lines = readfile('Xtestout')
|
||||
call assert_equal(4, len(lines))
|
||||
call assert_equal('one', lines[0])
|
||||
call assert_equal('-c', lines[1])
|
||||
call assert_equal('echo', lines[2])
|
||||
call assert_equal('two', lines[3])
|
||||
endif
|
||||
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
func Test_startuptime()
|
||||
if !has('startuptime')
|
||||
return
|
||||
endif
|
||||
let after = ['qall']
|
||||
if RunVim([], after, '--startuptime Xtestout one')
|
||||
let lines = readfile('Xtestout')
|
||||
let expected = ['--- VIM STARTING ---', 'parsing arguments',
|
||||
\ 'shell init', 'inits 3', 'start termcap', 'opening buffers']
|
||||
let found = []
|
||||
for line in lines
|
||||
for exp in expected
|
||||
if line =~ exp
|
||||
call add(found, exp)
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
call assert_equal(expected, found)
|
||||
endif
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
func Test_read_stdin()
|
||||
let after = [
|
||||
\ 'write Xtestout',
|
||||
\ 'quit!',
|
||||
\ ]
|
||||
if RunVimPiped([], after, '-', 'echo something | ')
|
||||
let lines = readfile('Xtestout')
|
||||
" MS-Windows adds a space after the word
|
||||
call assert_equal(['something'], split(lines[0]))
|
||||
endif
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
" Test for timers
|
||||
|
||||
source shared.vim
|
||||
|
||||
if !has('timers')
|
||||
finish
|
||||
endif
|
||||
|
||||
func MyHandler(timer)
|
||||
let s:val += 1
|
||||
let g:val += 1
|
||||
endfunc
|
||||
|
||||
func MyHandlerWithLists(lists, timer)
|
||||
@@ -13,43 +15,101 @@ func MyHandlerWithLists(lists, timer)
|
||||
endfunc
|
||||
|
||||
func Test_oneshot()
|
||||
let s:val = 0
|
||||
let g:val = 0
|
||||
let timer = timer_start(50, 'MyHandler')
|
||||
sleep 200m
|
||||
call assert_equal(1, s:val)
|
||||
let slept = WaitFor('g:val == 1')
|
||||
call assert_equal(1, g:val)
|
||||
call assert_inrange(30, 100, slept)
|
||||
endfunc
|
||||
|
||||
func Test_repeat_three()
|
||||
let s:val = 0
|
||||
let g:val = 0
|
||||
let timer = timer_start(50, 'MyHandler', {'repeat': 3})
|
||||
sleep 500m
|
||||
call assert_equal(3, s:val)
|
||||
let slept = WaitFor('g:val == 3')
|
||||
call assert_equal(3, g:val)
|
||||
call assert_inrange(80, 200, slept)
|
||||
endfunc
|
||||
|
||||
func Test_repeat_many()
|
||||
let s:val = 0
|
||||
let g:val = 0
|
||||
let timer = timer_start(50, 'MyHandler', {'repeat': -1})
|
||||
sleep 200m
|
||||
call timer_stop(timer)
|
||||
call assert_true(s:val > 1)
|
||||
call assert_true(s:val < 5)
|
||||
call assert_inrange(2, 4, g:val)
|
||||
endfunc
|
||||
|
||||
func Test_with_partial_callback()
|
||||
let s:val = 0
|
||||
let g:val = 0
|
||||
let s:meow = {}
|
||||
function s:meow.bite(...)
|
||||
let s:val += 1
|
||||
let g:val += 1
|
||||
endfunction
|
||||
|
||||
call timer_start(50, s:meow.bite)
|
||||
sleep 200m
|
||||
call assert_equal(1, s:val)
|
||||
let slept = WaitFor('g:val == 1')
|
||||
call assert_equal(1, g:val)
|
||||
call assert_inrange(30, 100, slept)
|
||||
endfunc
|
||||
|
||||
func Test_retain_partial()
|
||||
call timer_start(100, function('MyHandlerWithLists', [['a']]))
|
||||
call timer_start(50, function('MyHandlerWithLists', [['a']]))
|
||||
call test_garbagecollect_now()
|
||||
sleep 200m
|
||||
sleep 100m
|
||||
endfunc
|
||||
|
||||
func Test_info()
|
||||
let id = timer_start(1000, 'MyHandler')
|
||||
let info = timer_info(id)
|
||||
call assert_equal(id, info[0]['id'])
|
||||
call assert_equal(1000, info[0]['time'])
|
||||
call assert_true(info[0]['remaining'] > 500)
|
||||
call assert_true(info[0]['remaining'] <= 1000)
|
||||
call assert_equal(1, info[0]['repeat'])
|
||||
call assert_equal("function('MyHandler')", string(info[0]['callback']))
|
||||
|
||||
let found = 0
|
||||
for info in timer_info()
|
||||
if info['id'] == id
|
||||
let found += 1
|
||||
endif
|
||||
endfor
|
||||
call assert_equal(1, found)
|
||||
|
||||
call timer_stop(id)
|
||||
call assert_equal([], timer_info(id))
|
||||
endfunc
|
||||
|
||||
func Test_stopall()
|
||||
let id1 = timer_start(1000, 'MyHandler')
|
||||
let id2 = timer_start(2000, 'MyHandler')
|
||||
let info = timer_info()
|
||||
call assert_equal(2, len(info))
|
||||
|
||||
call timer_stopall()
|
||||
let info = timer_info()
|
||||
call assert_equal(0, len(info))
|
||||
endfunc
|
||||
|
||||
func Test_paused()
|
||||
let g:val = 0
|
||||
|
||||
let id = timer_start(50, 'MyHandler')
|
||||
let info = timer_info(id)
|
||||
call assert_equal(0, info[0]['paused'])
|
||||
|
||||
call timer_pause(id, 1)
|
||||
let info = timer_info(id)
|
||||
call assert_equal(1, info[0]['paused'])
|
||||
sleep 100m
|
||||
call assert_equal(0, g:val)
|
||||
|
||||
call timer_pause(id, 0)
|
||||
let info = timer_info(id)
|
||||
call assert_equal(0, info[0]['paused'])
|
||||
|
||||
let slept = WaitFor('g:val == 1')
|
||||
call assert_equal(1, g:val)
|
||||
call assert_inrange(0, 10, slept)
|
||||
endfunc
|
||||
|
||||
" vim: ts=2 sw=0 et
|
||||
|
||||
@@ -763,6 +763,74 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2188,
|
||||
/**/
|
||||
2187,
|
||||
/**/
|
||||
2186,
|
||||
/**/
|
||||
2185,
|
||||
/**/
|
||||
2184,
|
||||
/**/
|
||||
2183,
|
||||
/**/
|
||||
2182,
|
||||
/**/
|
||||
2181,
|
||||
/**/
|
||||
2180,
|
||||
/**/
|
||||
2179,
|
||||
/**/
|
||||
2178,
|
||||
/**/
|
||||
2177,
|
||||
/**/
|
||||
2176,
|
||||
/**/
|
||||
2175,
|
||||
/**/
|
||||
2174,
|
||||
/**/
|
||||
2173,
|
||||
/**/
|
||||
2172,
|
||||
/**/
|
||||
2171,
|
||||
/**/
|
||||
2170,
|
||||
/**/
|
||||
2169,
|
||||
/**/
|
||||
2168,
|
||||
/**/
|
||||
2167,
|
||||
/**/
|
||||
2166,
|
||||
/**/
|
||||
2165,
|
||||
/**/
|
||||
2164,
|
||||
/**/
|
||||
2163,
|
||||
/**/
|
||||
2162,
|
||||
/**/
|
||||
2161,
|
||||
/**/
|
||||
2160,
|
||||
/**/
|
||||
2159,
|
||||
/**/
|
||||
2158,
|
||||
/**/
|
||||
2157,
|
||||
/**/
|
||||
2156,
|
||||
/**/
|
||||
2155,
|
||||
/**/
|
||||
2154,
|
||||
/**/
|
||||
|
||||
@@ -2439,10 +2439,8 @@ typedef enum
|
||||
#define JSON_JS 1 /* use JS instead of JSON */
|
||||
#define JSON_NO_NONE 2 /* v:none item not allowed */
|
||||
|
||||
#ifdef FEAT_MZSCHEME
|
||||
/* this is in main.c, cproto can't handle it. */
|
||||
int vim_main2(int argc, char **argv);
|
||||
#endif
|
||||
/* This is in main.c, cproto can't handle it. */
|
||||
int vim_main2(void);
|
||||
|
||||
/* Used for flags of do_in_path() */
|
||||
#define DIP_ALL 0x01 /* all matches, not just the first one */
|
||||
@@ -2451,6 +2449,8 @@ int vim_main2(int argc, char **argv);
|
||||
#define DIP_START 0x08 /* also use "start" directory in 'packpath' */
|
||||
#define DIP_OPT 0x10 /* also use "opt" directory in 'packpath' */
|
||||
#define DIP_NORTP 0x20 /* do not use 'runtimepath' */
|
||||
#define DIP_NOAFTER 0x40 /* skip "after" directories */
|
||||
#define DIP_AFTER 0x80 /* only use "after" directories */
|
||||
|
||||
/* Lowest number used for window ID. Cannot have this many windows. */
|
||||
#define LOWEST_WIN_ID 1000
|
||||
|
||||
Reference in New Issue
Block a user