mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
feat(lua): allow :=expr
as a shorter version of :lua =expr
existing behavior of := and :[range]= are unchanged. `|` is still allowed with this usage. However, :=p and similar are changed in a way which could be construed as a breaking change. Allowing |ex-flags| for := in the first place was a mistake as any form of := DOES NOT MOVE THE CURSOR. So it would print one line number and then print a completely different line contents after that.
This commit is contained in:
@@ -5658,8 +5658,13 @@ static void ex_pwd(exarg_T *eap)
|
||||
/// ":=".
|
||||
static void ex_equal(exarg_T *eap)
|
||||
{
|
||||
smsg("%" PRId64, (int64_t)eap->line2);
|
||||
ex_may_print(eap);
|
||||
if (*eap->arg != NUL && *eap->arg != '|') {
|
||||
// equivalent to :lua= expr
|
||||
ex_lua(eap);
|
||||
} else {
|
||||
eap->nextcmd = find_nextcmd(eap->arg);
|
||||
smsg("%" PRId64, (int64_t)eap->line2);
|
||||
}
|
||||
}
|
||||
|
||||
static void ex_sleep(exarg_T *eap)
|
||||
|
Reference in New Issue
Block a user