Skip to content

Commit f00d408

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 8c7a6e2 + fa29c8a commit f00d408

76 files changed

Lines changed: 1826 additions & 372 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

runtime/doc/eval.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ There are ten types of variables:
4848

4949
*Number* *Integer*
5050
Number A 32 or 64 bit signed number. |expr-number|
51-
64-bit Numbers are available only when compiled with the
52-
|+num64| feature.
51+
The number of bits is available in |v:numbersize|.
5352
Examples: -123 0x10 0177 0b1011
5453

5554
Float A floating point number. |floating-point-format| *Float*
@@ -1991,6 +1990,10 @@ v:null An empty String. Used to put "null" in JSON. See
19911990
That is so that eval() can parse the string back to the same
19921991
value. Read-only.
19931992

1993+
*v:numbersize* *numbersize-variable*
1994+
v:numbersize Number of bits in a Number. This is normally 64, but on some
1995+
systems it my be 32.
1996+
19941997
*v:oldfiles* *oldfiles-variable*
19951998
v:oldfiles List of file names that is loaded from the |viminfo| file on
19961999
startup. These are the files that Vim remembers marks for.
@@ -2873,6 +2876,8 @@ test_null_job() Job null value for testing
28732876
test_null_list() List null value for testing
28742877
test_null_partial() Funcref null value for testing
28752878
test_null_string() String null value for testing
2879+
test_unknown() any unknown value for testing
2880+
test_void() any void value for testing
28762881
test_option_not_set({name}) none reset flag indicating option was set
28772882
test_override({expr}, {val}) none test with Vim internal overrides
28782883
test_refcount({expr}) Number get the reference count of {expr}

runtime/doc/popup.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*popup.txt* For Vim version 8.2. Last change: 2020 Feb 05
1+
*popup.txt* For Vim version 8.2. Last change: 2020 Feb 20
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -148,6 +148,8 @@ different: *E863*
148148
- The popup window always has focus, it is not possible to switch to another
149149
window.
150150
- When the job ends, the popup window closes.
151+
- The popup window can be closed with `popup_close()`, the terminal buffer
152+
then becomes hidden.
151153
- The default Pmenu color is only used for the border and padding. To change
152154
the color of the terminal itself set 'wincolor'.
153155

runtime/doc/testing.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ test_null_string() *test_null_string()*
123123
Return a |String| that is null. Only useful for testing.
124124

125125

126+
test_unknown() *test_unknown()*
127+
Return a value with unknown type. Only useful for testing.
128+
129+
test_void() *test_void()*
130+
Return a value with void type. Only useful for testing.
131+
132+
126133
test_option_not_set({name}) *test_option_not_set()*
127134
Reset the flag that indicates option {name} was set. Thus it
128135
looks like it still has the default value. Use like this: >

runtime/doc/various.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*various.txt* For Vim version 8.2. Last change: 2019 Dec 07
1+
*various.txt* For Vim version 8.2. Last change: 2020 Feb 22
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -408,7 +408,9 @@ N *+multi_lang* non-English language support |multi-lang|
408408
m *+mzscheme* Mzscheme interface |mzscheme|
409409
m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn|
410410
m *+netbeans_intg* |netbeans|
411-
*+num64* 64-bit Number support |Number|
411+
*+num64* 64-bit Number support |Number|
412+
Always enabled since 8.2.0271, use v:numbersize to
413+
check the actual size of a Number.
412414
m *+odbeditor* MacVim only: ODB Editor Protocol support |odbeditor|
413415
m *+ole* Win32 GUI only: |ole-interface|
414416
N *+packages* Loading |packages|

runtime/doc/vim9.txt

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*vim9.txt* For Vim version 8.2. Last change: 2020 Feb 13
1+
*vim9.txt* For Vim version 8.2. Last change: 2020 Feb 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -131,14 +131,23 @@ Functions can be called without `:call`: >
131131
Using `:call` is still possible, but this is discouraged.
132132

133133
A method call without `eval` is possible, so long as the start is an
134-
identifier or can't be an Ex command. It does not work for string constants: >
134+
identifier or can't be an Ex command. It does NOT work for string constants: >
135135
myList->add(123) " works
136136
g:myList->add(123) " works
137137
[1, 2, 3]->Process() " works
138138
#{a: 1, b: 2}->Process() " works
139139
{'a': 1, 'b': 2}->Process() " works
140140
"foobar"->Process() " does NOT work
141-
eval "foobar"->Process() " works
141+
("foobar")->Process() " works
142+
'foobar'->Process() " does NOT work
143+
('foobar')->Process() " works
144+
145+
In case there is ambiguity between a function name and an Ex command, use ":"
146+
to make clear you want to use the Ex command. For example, there is both the
147+
`:substitute` command and the `substitute()` function. When the line starts
148+
with `substitute(` this will use the function, prepend a colon to use the
149+
command instead: >
150+
:substitute(pattern (replacement (
142151
143152
144153
No curly braces expansion ~
@@ -175,6 +184,9 @@ White space is not allowed:
175184
call Func(arg) " OK
176185
call Func(
177186
\ arg) " OK
187+
call Func(
188+
\ arg " OK
189+
\ )
178190
179191
180192
Conditions and expressions ~
@@ -254,6 +266,12 @@ THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
254266
:enddef End of a function defined with `:def`.
255267

256268

269+
If the script the function is defined in is Vim9 script, then script-local
270+
variables can be accessed without the "s:" prefix. They must be defined
271+
before the function. If the script the function is defined in is legacy
272+
script, then script-local variables must be accessed with the "s:" prefix.
273+
274+
257275
*:disa* *:disassemble*
258276
:disa[ssemble] {func} Show the instructions generated for {func}.
259277
This is for debugging and testing.

src/drawline.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,11 @@ win_line(
11401140
}
11411141

11421142
#ifdef FEAT_LINEBREAK
1143-
if (wp->w_p_brisbr && draw_state == WL_BRI - 1
1143+
if (wp->w_briopt_sbr && draw_state == WL_BRI - 1
11441144
&& n_extra == 0 && *get_showbreak_value(wp) != NUL)
11451145
// draw indent after showbreak value
11461146
draw_state = WL_BRI;
1147-
else if (wp->w_p_brisbr && draw_state == WL_SBR && n_extra == 0)
1147+
else if (wp->w_briopt_sbr && draw_state == WL_SBR && n_extra == 0)
11481148
// After the showbreak, draw the breakindent
11491149
draw_state = WL_BRI - 1;
11501150

@@ -1176,7 +1176,7 @@ win_line(
11761176
c_final = NUL;
11771177
n_extra = get_breakindent_win(wp,
11781178
ml_get_buf(wp->w_buffer, lnum, FALSE));
1179-
if (wp->w_skipcol > 0 && wp->w_p_wrap)
1179+
if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_briopt_sbr)
11801180
need_showbreak = FALSE;
11811181
// Correct end of highlighted area for 'breakindent',
11821182
// required when 'linebreak' is also set.

src/eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5665,7 +5665,7 @@ tv_get_string_buf_chk(typval_T *varp, char_u *buf)
56655665
{
56665666
case VAR_NUMBER:
56675667
vim_snprintf((char *)buf, NUMBUFLEN, "%lld",
5668-
(long_long_T)varp->vval.v_number);
5668+
(varnumber_T)varp->vval.v_number);
56695669
return buf;
56705670
case VAR_FUNC:
56715671
case VAR_PARTIAL:

src/evalfunc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,8 @@ static funcentry_T global_functions[] =
821821
{"test_setmouse", 2, 2, 0, &t_void, f_test_setmouse},
822822
{"test_settime", 1, 1, FEARG_1, &t_void, f_test_settime},
823823
{"test_srand_seed", 0, 1, FEARG_1, &t_void, f_test_srand_seed},
824+
{"test_unknown", 0, 0, 0, &t_any, f_test_unknown},
825+
{"test_void", 0, 0, 0, &t_any, f_test_void},
824826
#ifdef FEAT_TIMERS
825827
{"timer_info", 0, 1, FEARG_1, &t_list_dict_any, f_timer_info},
826828
{"timer_pause", 2, 2, FEARG_1, &t_void, f_timer_pause},

src/evalvars.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ static struct vimvar
120120
{VV_NAME("errors", VAR_LIST), 0},
121121
{VV_NAME("false", VAR_BOOL), VV_RO},
122122
{VV_NAME("true", VAR_BOOL), VV_RO},
123-
{VV_NAME("null", VAR_SPECIAL), VV_RO},
124123
{VV_NAME("none", VAR_SPECIAL), VV_RO},
124+
{VV_NAME("null", VAR_SPECIAL), VV_RO},
125+
{VV_NAME("numbersize", VAR_NUMBER), VV_RO},
125126
{VV_NAME("vim_did_enter", VAR_NUMBER), VV_RO},
126127
{VV_NAME("testing", VAR_NUMBER), 0},
127128
{VV_NAME("t_number", VAR_NUMBER), VV_RO},
@@ -231,6 +232,7 @@ evalvars_init(void)
231232
set_vim_var_nr(VV_TRUE, VVAL_TRUE);
232233
set_vim_var_nr(VV_NONE, VVAL_NONE);
233234
set_vim_var_nr(VV_NULL, VVAL_NULL);
235+
set_vim_var_nr(VV_NUMBERSIZE, sizeof(varnumber_T) * 8);
234236

235237
set_vim_var_nr(VV_TYPE_NUMBER, VAR_TYPE_NUMBER);
236238
set_vim_var_nr(VV_TYPE_STRING, VAR_TYPE_STRING);

src/ex_docmd.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,9 @@ do_one_cmd(
16531653
int save_reg_executing = reg_executing;
16541654
int ni; // set when Not Implemented
16551655
char_u *cmd;
1656+
#ifdef FEAT_EVAL
1657+
int starts_with_colon;
1658+
#endif
16561659

16571660
vim_memset(&ea, 0, sizeof(ea));
16581661
ea.line1 = 1;
@@ -1695,6 +1698,7 @@ do_one_cmd(
16951698
ea.cookie = cookie;
16961699
#ifdef FEAT_EVAL
16971700
ea.cstack = cstack;
1701+
starts_with_colon = *skipwhite(ea.cmd) == ':';
16981702
#endif
16991703
if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
17001704
goto doend;
@@ -1719,7 +1723,7 @@ do_one_cmd(
17191723
ea.cmd = skipwhite(ea.cmd + 1);
17201724

17211725
#ifdef FEAT_EVAL
1722-
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
1726+
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9 && !starts_with_colon)
17231727
p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL);
17241728
else
17251729
#endif
@@ -3152,8 +3156,9 @@ find_ex_command(
31523156
* Recognize a Vim9 script function/method call and assignment:
31533157
* "lvar = value", "lvar(arg)", "[1, 2 3]->Func()"
31543158
*/
3155-
if (lookup != NULL && (p = to_name_const_end(eap->cmd)) > eap->cmd
3156-
&& *p != NUL)
3159+
p = eap->cmd;
3160+
if (lookup != NULL && (*p == '('
3161+
|| ((p = to_name_const_end(eap->cmd)) > eap->cmd && *p != NUL)))
31573162
{
31583163
int oplen;
31593164
int heredoc;
@@ -3162,6 +3167,7 @@ find_ex_command(
31623167
// "varname[]" is an expression.
31633168
// "g:varname" is an expression.
31643169
// "varname->expr" is an expression.
3170+
// "(..." is an expression.
31653171
if (*p == '('
31663172
|| *p == '['
31673173
|| p[1] == ':'
@@ -3677,7 +3683,7 @@ get_address(
36773683
curwin->w_cursor.col = 0;
36783684
searchcmdlen = 0;
36793685
flags = silent ? 0 : SEARCH_HIS | SEARCH_MSG;
3680-
if (!do_search(NULL, c, cmd, 1L, flags, NULL))
3686+
if (!do_search(NULL, c, c, cmd, 1L, flags, NULL))
36813687
{
36823688
curwin->w_cursor = pos;
36833689
cmd = NULL;
@@ -6191,9 +6197,11 @@ do_exedit(
61916197
hold_gui_events = 0;
61926198
#endif
61936199
must_redraw = CLEAR;
6200+
pending_exmode_active = TRUE;
61946201

61956202
main_loop(FALSE, TRUE);
61966203

6204+
pending_exmode_active = FALSE;
61976205
RedrawingDisabled = rd;
61986206
no_wait_return = nwr;
61996207
msg_scroll = ms;

0 commit comments

Comments
 (0)