diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-04 07:19:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 07:19:02 +0800 |
commit | 92760a7f42a95bb252966c2a38423e5bc9d57cc7 (patch) | |
tree | 6dbcee0ac50a90b638f0615aeec6dccfd003ef12 /test/functional/lua | |
parent | 35c3275b4896a65d67caf2a4355d7516b6ddec29 (diff) | |
download | rneovim-92760a7f42a95bb252966c2a38423e5bc9d57cc7.tar.gz rneovim-92760a7f42a95bb252966c2a38423e5bc9d57cc7.tar.bz2 rneovim-92760a7f42a95bb252966c2a38423e5bc9d57cc7.zip |
fix(api, lua): make blank lines in a message work properly (#24244)
Diffstat (limited to 'test/functional/lua')
-rw-r--r-- | test/functional/lua/overrides_spec.lua | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 0fd8cb2f6a..1777dd078d 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -15,8 +15,6 @@ local exec_lua = helpers.exec_lua local pcall_err = helpers.pcall_err local is_os = helpers.is_os -local screen - local fname = 'Xtest-functional-lua-overrides-luafile' before_each(clear) @@ -138,9 +136,44 @@ describe('print', function() ]], (is_os('win') and "timeout 1") or "sleep 0.1") eq('very slow\nvery fast', exec_capture('lua test()')) end) + + it('blank line in message works', function() + local screen = Screen.new(40, 8) + screen:attach() + screen:set_default_attr_ids({ + [0] = {bold = true, foreground=Screen.colors.Blue}, + [1] = {bold = true, foreground = Screen.colors.SeaGreen}, + [2] = {bold = true, reverse = true}, + }) + feed([[:lua print('\na')<CR>]]) + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + {0:~ }| + {2: }| + | + a | + {1:Press ENTER or type command to continue}^ | + ]]} + feed('<CR>') + feed([[:lua print('b\n\nc')<CR>]]) + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + {2: }| + b | + | + c | + {1:Press ENTER or type command to continue}^ | + ]]} + end) end) describe('debug.debug', function() + local screen + before_each(function() screen = Screen.new() screen:attach() |