Skip to content

Commit 0dc0f91

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents b2dc98e + 181ca99 commit 0dc0f91

23 files changed

Lines changed: 481 additions & 239 deletions

runtime/doc/eval.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,7 @@ argidx() Number current index in the argument list
20172017
arglistid([{winnr} [, {tabnr}]]) Number argument list id
20182018
argv({nr}) String {nr} entry of the argument list
20192019
argv() List the argument list
2020+
assert_beeps({cmd}) none assert {cmd} causes a beep
20202021
assert_equal({exp}, {act} [, {msg}])
20212022
none assert {exp} is equal to {act}
20222023
assert_exception({error} [, {msg}])
@@ -2151,6 +2152,7 @@ getbufline({expr}, {lnum} [, {end}])
21512152
List lines {lnum} to {end} of buffer {expr}
21522153
getbufvar({expr}, {varname} [, {def}])
21532154
any variable {varname} in buffer {expr}
2155+
getchangelist({expr}) List list of change list items
21542156
getchar([expr]) Number get one character from the user
21552157
getcharmod() Number modifiers for the last typed character
21562158
getcharsearch() Dict last character search
@@ -2568,6 +2570,11 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
25682570
< Without the {nr} argument a |List| with the whole |arglist| is
25692571
returned.
25702572

2573+
assert_beeps({cmd}) *assert_beeps()*
2574+
Run {cmd} and add an error message to |v:errors| if it does
2575+
NOT produce a beep or visual bell.
2576+
Also see |assert_fails()|.
2577+
25712578
*assert_equal()*
25722579
assert_equal({expected}, {actual} [, {msg}])
25732580
When {expected} and {actual} are not equal an error message is
@@ -2600,6 +2607,8 @@ assert_fails({cmd} [, {error}]) *assert_fails()*
26002607
Run {cmd} and add an error message to |v:errors| if it does
26012608
NOT produce an error.
26022609
When {error} is given it must match in |v:errmsg|.
2610+
Note that beeping is not considered an error, and some failing
2611+
commands only beep. Use |assert_beeps()| for those.
26032612

26042613
assert_false({actual} [, {msg}]) *assert_false()*
26052614
When {actual} is not false an error message is added to
@@ -4270,6 +4279,22 @@ getbufvar({expr}, {varname} [, {def}]) *getbufvar()*
42704279
:let bufmodified = getbufvar(1, "&mod")
42714280
:echo "todo myvar = " . getbufvar("todo", "myvar")
42724281
<
4282+
getchangelist({expr}) *getchangelist()*
4283+
Returns the |changelist| for the buffer {expr}. For the use
4284+
of {expr}, see |bufname()| above. If buffer {expr} doesn't
4285+
exist, an empty list is returned.
4286+
4287+
The returned list contains two entries: a list with the change
4288+
locations and the current position in the list. Each
4289+
entry in the change list is a dictionary with the following
4290+
entries:
4291+
col column number
4292+
coladd column offset for 'virtualedit'
4293+
lnum line number
4294+
If buffer {expr} is the current buffer, then the current
4295+
position refers to the position in the list. For other
4296+
buffers, it is set to the length of the list.
4297+
42734298
getchar([expr]) *getchar()*
42744299
Get a single character from the user or input stream.
42754300
If [expr] is omitted, wait until a character is available.

runtime/doc/usr_41.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ Buffers, windows and the argument list:
807807
getbufinfo() get a list with buffer information
808808
gettabinfo() get a list with tab page information
809809
getwininfo() get a list with window information
810+
getchangelist() get a list of change list entries
810811
getjumplist() get a list of jump list entries
811812

812813
Command line: *command-line-functions*

src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@ test_arglist \
21442144
test_cd \
21452145
test_cdo \
21462146
test_changedtick \
2147+
test_changelist \
21472148
test_channel \
21482149
test_charsearch \
21492150
test_charsearch_utf8 \

src/channel.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
44934493
return OK;
44944494
if (tv->v_type != VAR_DICT)
44954495
{
4496-
EMSG(_(e_invarg));
4496+
EMSG(_(e_dictreq));
44974497
return FAIL;
44984498
}
44994499
dict = tv->vval.v_dict;
@@ -4576,7 +4576,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
45764576
opt->jo_io_buf[part] = get_tv_number(item);
45774577
if (opt->jo_io_buf[part] <= 0)
45784578
{
4579-
EMSG2(_(e_invarg2), get_tv_string(item));
4579+
EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
45804580
return FAIL;
45814581
}
45824582
if (buflist_findnr(opt->jo_io_buf[part]) == NULL)
@@ -4625,7 +4625,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46254625
*lp = get_tv_number(item);
46264626
if (*lp < 0)
46274627
{
4628-
EMSG2(_(e_invarg2), get_tv_string(item));
4628+
EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
46294629
return FAIL;
46304630
}
46314631
}
@@ -4636,7 +4636,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46364636
opt->jo_set |= JO_CHANNEL;
46374637
if (item->v_type != VAR_CHANNEL)
46384638
{
4639-
EMSG2(_(e_invarg2), "channel");
4639+
EMSG2(_(e_invargval), "channel");
46404640
return FAIL;
46414641
}
46424642
opt->jo_channel = item->vval.v_channel;
@@ -4649,7 +4649,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46494649
opt->jo_callback = get_callback(item, &opt->jo_partial);
46504650
if (opt->jo_callback == NULL)
46514651
{
4652-
EMSG2(_(e_invarg2), "callback");
4652+
EMSG2(_(e_invargval), "callback");
46534653
return FAIL;
46544654
}
46554655
}
@@ -4661,7 +4661,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46614661
opt->jo_out_cb = get_callback(item, &opt->jo_out_partial);
46624662
if (opt->jo_out_cb == NULL)
46634663
{
4664-
EMSG2(_(e_invarg2), "out_cb");
4664+
EMSG2(_(e_invargval), "out_cb");
46654665
return FAIL;
46664666
}
46674667
}
@@ -4673,7 +4673,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46734673
opt->jo_err_cb = get_callback(item, &opt->jo_err_partial);
46744674
if (opt->jo_err_cb == NULL)
46754675
{
4676-
EMSG2(_(e_invarg2), "err_cb");
4676+
EMSG2(_(e_invargval), "err_cb");
46774677
return FAIL;
46784678
}
46794679
}
@@ -4685,7 +4685,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46854685
opt->jo_close_cb = get_callback(item, &opt->jo_close_partial);
46864686
if (opt->jo_close_cb == NULL)
46874687
{
4688-
EMSG2(_(e_invarg2), "close_cb");
4688+
EMSG2(_(e_invargval), "close_cb");
46894689
return FAIL;
46904690
}
46914691
}
@@ -4698,7 +4698,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
46984698
never = TRUE;
46994699
else if (STRCMP(val, "auto") != 0)
47004700
{
4701-
EMSG2(_(e_invarg2), "drop");
4701+
EMSG3(_(e_invargNval), "drop", val);
47024702
return FAIL;
47034703
}
47044704
opt->jo_drop_never = never;
@@ -4711,7 +4711,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
47114711
opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial);
47124712
if (opt->jo_exit_cb == NULL)
47134713
{
4714-
EMSG2(_(e_invarg2), "exit_cb");
4714+
EMSG2(_(e_invargval), "exit_cb");
47154715
return FAIL;
47164716
}
47174717
}
@@ -4724,7 +4724,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
47244724
opt->jo_term_name = get_tv_string_chk(item);
47254725
if (opt->jo_term_name == NULL)
47264726
{
4727-
EMSG2(_(e_invarg2), "term_name");
4727+
EMSG2(_(e_invargval), "term_name");
47284728
return FAIL;
47294729
}
47304730
}
@@ -4735,7 +4735,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
47354735
val = get_tv_string(item);
47364736
if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0)
47374737
{
4738-
EMSG2(_(e_invarg2), val);
4738+
EMSG3(_(e_invargNval), "term_finish", val);
47394739
return FAIL;
47404740
}
47414741
opt->jo_set2 |= JO2_TERM_FINISH;
@@ -4759,7 +4759,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
47594759
}
47604760
if (p == NULL)
47614761
{
4762-
EMSG2(_(e_invarg2), "term_opencmd");
4762+
EMSG2(_(e_invargval), "term_opencmd");
47634763
return FAIL;
47644764
}
47654765
}
@@ -4773,7 +4773,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
47734773
p = opt->jo_eof_chars = get_tv_string_chk(item);
47744774
if (p == NULL)
47754775
{
4776-
EMSG2(_(e_invarg2), "term_opencmd");
4776+
EMSG2(_(e_invargval), "eof_chars");
47774777
return FAIL;
47784778
}
47794779
}
@@ -4828,7 +4828,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
48284828
opt->jo_cwd = get_tv_string_buf_chk(item, opt->jo_cwd_buf);
48294829
if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd))
48304830
{
4831-
EMSG2(_(e_invarg2), "cwd");
4831+
EMSG2(_(e_invargval), "cwd");
48324832
return FAIL;
48334833
}
48344834
opt->jo_set |= JO2_CWD;
@@ -4873,7 +4873,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
48734873
opt->jo_part = PART_OUT;
48744874
else
48754875
{
4876-
EMSG2(_(e_invarg2), val);
4876+
EMSG3(_(e_invargNval), "part", val);
48774877
return FAIL;
48784878
}
48794879
}
@@ -4893,7 +4893,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
48934893
opt->jo_soe_buf);
48944894
if (opt->jo_stoponexit == NULL)
48954895
{
4896-
EMSG2(_(e_invarg2), "stoponexit");
4896+
EMSG2(_(e_invargval), "stoponexit");
48974897
return FAIL;
48984898
}
48994899
}

0 commit comments

Comments
 (0)