From a92b38934a2d00c13ee4d1969d994da15e0857ab Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 20 Mar 2023 21:11:10 +0100 Subject: 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. --- test/functional/lua/commands_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/lua/commands_spec.lua') diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua index 943095c51e..5bb9e0281b 100644 --- a/test/functional/lua/commands_spec.lua +++ b/test/functional/lua/commands_spec.lua @@ -146,6 +146,7 @@ describe(':lua command', function() it('prints result of =expr', function() exec_lua("x = 5") eq("5", exec_capture(':lua =x')) + eq("5", exec_capture('=x')) exec_lua("function x() return 'hello' end") eq('hello', exec_capture(':lua = x()')) exec_lua("x = {a = 1, b = 2}") @@ -165,7 +166,7 @@ describe(':lua command', function() false nil Error message]], - exec_capture(':lua =x(false)')) + exec_capture('=x(false)')) end) end) -- cgit