aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-07-04 07:19:02 +0800
committerGitHub <noreply@github.com>2023-07-04 07:19:02 +0800
commit92760a7f42a95bb252966c2a38423e5bc9d57cc7 (patch)
tree6dbcee0ac50a90b638f0615aeec6dccfd003ef12 /test/functional/api/vim_spec.lua
parent35c3275b4896a65d67caf2a4355d7516b6ddec29 (diff)
downloadrneovim-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/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua38
1 files changed, 34 insertions, 4 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index c4f89318e0..664cd4cbca 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -577,7 +577,6 @@ describe('API', function()
local start_dir
before_each(function()
- clear()
funcs.mkdir("Xtestdir")
start_dir = funcs.getcwd()
end)
@@ -1990,6 +1989,39 @@ describe('API', function()
]])
eq('\naaa\n' .. ('a'):rep(5002) .. '\naaa', meths.get_var('out'))
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([[:call nvim_out_write("\na\n")<CR>]])
+ screen:expect{grid=[[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {2: }|
+ |
+ a |
+ {1:Press ENTER or type command to continue}^ |
+ ]]}
+ feed('<CR>')
+ feed([[:call nvim_out_write("b\n\nc\n")<CR>]])
+ screen:expect{grid=[[
+ |
+ {0:~ }|
+ {0:~ }|
+ {2: }|
+ b |
+ |
+ c |
+ {1:Press ENTER or type command to continue}^ |
+ ]]}
+ end)
end)
describe('nvim_err_write', function()
@@ -3029,11 +3061,10 @@ describe('API', function()
local screen
before_each(function()
- clear()
screen = Screen.new(40, 8)
screen:attach()
screen:set_default_attr_ids({
- [0] = {bold=true, foreground=Screen.colors.Blue},
+ [0] = {bold = true, foreground = Screen.colors.Blue},
[1] = {bold = true, foreground = Screen.colors.SeaGreen},
[2] = {bold = true, reverse = true},
[3] = {foreground = Screen.colors.Brown, bold = true}, -- Statement
@@ -3103,7 +3134,6 @@ describe('API', function()
local screen
before_each(function()
- clear()
screen = Screen.new(100, 35)
screen:attach()
screen:set_default_attr_ids({