Skip to content

Commit 032b103

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents fca0fd2 + 08815a1 commit 032b103

17 files changed

Lines changed: 275 additions & 64 deletions

runtime/doc/eval.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.2. Last change: 2020 Jul 09
1+
*eval.txt* For Vim version 8.2. Last change: 2020 Jul 19
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -94,8 +94,9 @@ the Number. Examples:
9494
Number 0 --> String "0" ~
9595
Number -1 --> String "-1" ~
9696
*octal*
97-
Conversion from a String to a Number is done by converting the first digits to
98-
a number. Hexadecimal "0xf9", Octal "017" or "0o17", and Binary "0b10"
97+
Conversion from a String to a Number only happens in legacy Vim script, not in
98+
Vim9 script. It is done by converting the first digits to a number.
99+
Hexadecimal "0xf9", Octal "017" or "0o17", and Binary "0b10"
99100
numbers are recognized (NOTE: when using |scriptversion-4| octal with a
100101
leading "0" is not recognized). If the String doesn't start with digits, the
101102
result is zero.
@@ -2843,7 +2844,7 @@ stridx({haystack}, {needle} [, {start}])
28432844
string({expr}) String String representation of {expr} value
28442845
strlen({expr}) Number length of the String {expr}
28452846
strpart({str}, {start} [, {len}])
2846-
String {len} characters of {str} at {start}
2847+
String {len} bytes of {str} at byte {start}
28472848
strptime({format}, {timestring})
28482849
Number Convert {timestring} to unix timestamp
28492850
strridx({haystack}, {needle} [, {start}])
@@ -9195,7 +9196,8 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
91959196
the last quickfix list.
91969197
quickfixtextfunc
91979198
function to get the text to display in the
9198-
quickfix window. Refer to
9199+
quickfix window. The value can be the name of
9200+
a function or a funcref or a lambda. Refer to
91999201
|quickfix-window-function| for an explanation
92009202
of how to write the function and an example.
92019203
title quickfix list title text. See |quickfix-title|

runtime/doc/options.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6062,7 +6062,8 @@ A jump table for the options with a short description can be found at |Q_op|.
60626062
customize the information displayed in the quickfix or location window
60636063
for each entry in the corresponding quickfix or location list. See
60646064
|quickfix-window-function| for an explanation of how to write the
6065-
function and an example.
6065+
function and an example. The value can be the name of a function or a
6066+
lambda.
60666067

60676068
This option cannot be set from a |modeline| or in the |sandbox|, for
60686069
security reasons.

runtime/doc/quickfix.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,10 @@ The function should return a single line of text to display in the quickfix
19641964
window for each entry from start_idx to end_idx. The function can obtain
19651965
information about the entries using the |getqflist()| function and specifying
19661966
the quickfix list identifier "id". For a location list, getloclist() function
1967-
can be used with the 'winid' argument.
1967+
can be used with the 'winid' argument. If an empty list is returned, then the
1968+
default format is used to display all the entries. If an item in the returned
1969+
list is an empty string, then the default format is used to display the
1970+
corresponding entry.
19681971

19691972
If a quickfix or location list specific customization is needed, then the
19701973
'quickfixtextfunc' attribute of the list can be set using the |setqflist()| or

src/channel.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,27 +1120,6 @@ channel_open(
11201120
return channel;
11211121
}
11221122

1123-
/*
1124-
* Copy callback from "src" to "dest", incrementing the refcounts.
1125-
*/
1126-
static void
1127-
copy_callback(callback_T *dest, callback_T *src)
1128-
{
1129-
dest->cb_partial = src->cb_partial;
1130-
if (dest->cb_partial != NULL)
1131-
{
1132-
dest->cb_name = src->cb_name;
1133-
dest->cb_free_name = FALSE;
1134-
++dest->cb_partial->pt_refcount;
1135-
}
1136-
else
1137-
{
1138-
dest->cb_name = vim_strsave(src->cb_name);
1139-
dest->cb_free_name = TRUE;
1140-
func_ref(src->cb_name);
1141-
}
1142-
}
1143-
11441123
static void
11451124
free_set_callback(callback_T *cbp, callback_T *callback)
11461125
{

src/evalvars.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3850,6 +3850,27 @@ set_callback(callback_T *dest, callback_T *src)
38503850
dest->cb_partial = src->cb_partial;
38513851
}
38523852

3853+
/*
3854+
* Copy callback from "src" to "dest", incrementing the refcounts.
3855+
*/
3856+
void
3857+
copy_callback(callback_T *dest, callback_T *src)
3858+
{
3859+
dest->cb_partial = src->cb_partial;
3860+
if (dest->cb_partial != NULL)
3861+
{
3862+
dest->cb_name = src->cb_name;
3863+
dest->cb_free_name = FALSE;
3864+
++dest->cb_partial->pt_refcount;
3865+
}
3866+
else
3867+
{
3868+
dest->cb_name = vim_strsave(src->cb_name);
3869+
dest->cb_free_name = TRUE;
3870+
func_ref(src->cb_name);
3871+
}
3872+
}
3873+
38533874
/*
38543875
* Unref/free "callback" returned by get_callback() or set_callback().
38553876
*/

src/ex_docmd.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,10 +3288,19 @@ find_ex_command(
32883288
// after the "]" by to_name_const_end(): check if a "=" follows.
32893289
// If "[...]" has a line break "p" still points at the "[" and it can't
32903290
// be an assignment.
3291-
if (*eap->cmd == '[' && (p == eap->cmd || *skipwhite(p) != '='))
3291+
if (*eap->cmd == '[')
32923292
{
3293-
eap->cmdidx = CMD_eval;
3294-
return eap->cmd;
3293+
p = to_name_const_end(eap->cmd);
3294+
if (p == eap->cmd || *skipwhite(p) != '=')
3295+
{
3296+
eap->cmdidx = CMD_eval;
3297+
return eap->cmd;
3298+
}
3299+
if (p > eap->cmd && *skipwhite(p) == '=')
3300+
{
3301+
eap->cmdidx = CMD_let;
3302+
return eap->cmd;
3303+
}
32953304
}
32963305

32973306
// Recognize an assignment if we recognize the variable name:

src/normal.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,12 @@ normal_cmd(
10261026
out_flush();
10271027
#endif
10281028
if (ca.cmdchar != K_IGNORE)
1029-
did_cursorhold = save_did_cursorhold;
1029+
{
1030+
if (ex_normal_busy)
1031+
did_cursorhold = save_did_cursorhold;
1032+
else
1033+
did_cursorhold = FALSE;
1034+
}
10301035

10311036
State = NORMAL;
10321037

src/optionstr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,14 @@ did_set_string_option(
22742274
# endif
22752275
#endif
22762276

2277+
#ifdef FEAT_QUICKFIX
2278+
else if (varp == &p_qftf)
2279+
{
2280+
if (qf_process_qftf_option() == FALSE)
2281+
errmsg = e_invarg;
2282+
}
2283+
#endif
2284+
22772285
// Options that are a list of flags.
22782286
else
22792287
{

src/proto/evalvars.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@ void f_setbufvar(typval_T *argvars, typval_T *rettv);
8888
callback_T get_callback(typval_T *arg);
8989
void put_callback(callback_T *cb, typval_T *tv);
9090
void set_callback(callback_T *dest, callback_T *src);
91+
void copy_callback(callback_T *dest, callback_T *src);
9192
void free_callback(callback_T *callback);
9293
/* vim: set ft=c : */

src/proto/quickfix.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void ex_cclose(exarg_T *eap);
1515
void ex_copen(exarg_T *eap);
1616
void ex_cbottom(exarg_T *eap);
1717
linenr_T qf_current_entry(win_T *wp);
18+
int qf_process_qftf_option(void);
1819
int grep_internal(cmdidx_T cmdidx);
1920
void ex_make(exarg_T *eap);
2021
int qf_get_size(exarg_T *eap);

0 commit comments

Comments
 (0)