aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-20 21:11:10 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-22 09:10:04 +0100
commita92b38934a2d00c13ee4d1969d994da15e0857ab (patch)
treef201f6bb3718b4788403b986664e596f809d5a98 /src/nvim/ex_docmd.c
parent4cba53e09e6e9d9cf06e87431146b9707347bcd6 (diff)
downloadrneovim-a92b38934a2d00c13ee4d1969d994da15e0857ab.tar.gz
rneovim-a92b38934a2d00c13ee4d1969d994da15e0857ab.tar.bz2
rneovim-a92b38934a2d00c13ee4d1969d994da15e0857ab.zip
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.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 7b94e3184b..6a259b75fb 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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)