forked from aniani/vim
patch 8.2.4426: map() function on string and blob does not check types
Problem: map() function on string and blob does not check argument types at compile time. Solution: Check string and blob argument types. Support "0z1234->func()".
This commit is contained in:
@@ -2818,13 +2818,16 @@ compile_def_function(
|
||||
/*
|
||||
* COMMAND after range
|
||||
* 'text'->func() should not be confused with 'a mark
|
||||
* 0z1234->func() should not be confused with a zero line number
|
||||
* "++nr" and "--nr" are eval commands
|
||||
* in "$ENV->func()" the "$" is not a range
|
||||
*/
|
||||
cmd = ea.cmd;
|
||||
if ((*cmd != '$' || starts_with_colon)
|
||||
&& (starts_with_colon || !(*cmd == '\''
|
||||
|| (cmd[0] != NUL && cmd[0] == cmd[1]
|
||||
&& (starts_with_colon
|
||||
|| !(*cmd == '\''
|
||||
|| (cmd[0] == '0' && cmd[1] == 'z')
|
||||
|| (cmd[0] != NUL && cmd[0] == cmd[1]
|
||||
&& (*cmd == '+' || *cmd == '-')))))
|
||||
{
|
||||
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
|
||||
|
Reference in New Issue
Block a user