aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval.c8
-rw-r--r--test/functional/lua/overrides_spec.lua15
2 files changed, 11 insertions, 12 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index fa817bb705..67b755f053 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -12363,8 +12363,8 @@ static void f_input(typval_T *argvars, typval_T *rettv, FunPtr fptr)
argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
? (const char *)get_tv_string_buf(&argvars[2], (char_u *)xp_name_buf)
: NULL);
- if (prompt == NULL || initval == NULL || (
- argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
+ if (prompt == NULL || initval == NULL
+ || (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
&& xp_name == NULL)) {
return;
}
@@ -12389,8 +12389,8 @@ static void f_inputdialog(typval_T *argvars, typval_T *rettv, FunPtr fptr)
argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
? (const char *)get_tv_string_buf(&argvars[2], (char_u *)cancelval_buf)
: NULL);
- if (prompt == NULL || initval == NULL || (
- argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
+ if (prompt == NULL || initval == NULL
+ || (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN
&& cancelval == NULL)) {
return;
}
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua
index 60a0589b48..c8aee130a7 100644
--- a/test/functional/lua/overrides_spec.lua
+++ b/test/functional/lua/overrides_spec.lua
@@ -79,14 +79,13 @@ describe('debug.debug', function()
})
end)
it('works', function()
- write_file(fname, [[
+ command([[lua
function Test(a)
print(a)
debug.debug()
print(a * 100)
end
]])
- eq('', redir_exec('luafile ' .. fname))
feed(':lua Test()\n')
screen:expect([[
{0:~ }|
@@ -133,9 +132,9 @@ describe('debug.debug', function()
lua_debug> print("TEST") |
TEST |
|
- {E:E5105: Error while calling lua chunk: Xtest-functiona}|
- {E:l-lua-overrides-luafile:4: attempt to perform arithme}|
- {E:tic on local 'a' (a nil value)} |
+ {E:E5105: Error while calling lua chunk: [string "<VimL }|
+ {E:compiled string>"]:5: attempt to perform arithmetic o}|
+ {E:n local 'a' (a nil value)} |
Interrupt: {cr:Press ENTER or type command to continue}^ |
]])
feed('<C-l>:lua Test()\n')
@@ -167,9 +166,9 @@ describe('debug.debug', function()
{0:~ }|
nil |
lua_debug> |
- {E:E5105: Error while calling lua chunk: Xtest-functiona}|
- {E:l-lua-overrides-luafile:4: attempt to perform arithme}|
- {E:tic on local 'a' (a nil value)} |
+ {E:E5105: Error while calling lua chunk: [string "<VimL }|
+ {E:compiled string>"]:5: attempt to perform arithmetic o}|
+ {E:n local 'a' (a nil value)} |
{cr:Press ENTER or type command to continue}^ |
]])
end)