mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.5026: Vim9: a few lines not covered by tests
Problem: Vim9: a few lines not covered by tests. Solution: Delete dead code. Add a few test cases. make "12->func()" work.
This commit is contained in:
@@ -3506,6 +3506,18 @@ one_letter_cmd(char_u *p, cmdidx_T *idx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "cmd" starts with "123->", a number followed by a method
|
||||
* call.
|
||||
*/
|
||||
int
|
||||
number_method(char_u *cmd)
|
||||
{
|
||||
char_u *p = skipdigits(cmd);
|
||||
|
||||
return p > cmd && (p = skipwhite(p))[0] == '-' && p[1] == '>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Find an Ex command by its name, either built-in or user.
|
||||
* Start of the name can be found at eap->cmd.
|
||||
@@ -3716,6 +3728,13 @@ find_ex_command(
|
||||
}
|
||||
}
|
||||
|
||||
// 1234->func() is a method call
|
||||
if (number_method(eap->cmd))
|
||||
{
|
||||
eap->cmdidx = CMD_eval;
|
||||
return eap->cmd;
|
||||
}
|
||||
|
||||
// "g:", "s:" and "l:" are always assumed to be a variable, thus start
|
||||
// an expression. A global/substitute/list command needs to use a
|
||||
// longer name.
|
||||
|
Reference in New Issue
Block a user