fix(api, lua): make blank lines in a message work properly

(cherry picked from commit e6bb22e691)
This commit is contained in:
zeertzjq
2023-07-04 05:25:20 +08:00
committed by github-actions[bot]
parent 041bc87333
commit 617c6014ea
4 changed files with 71 additions and 6 deletions

View File

@@ -571,7 +571,6 @@ describe('API', function()
local start_dir
before_each(function()
clear()
funcs.mkdir("Xtestdir")
start_dir = funcs.getcwd()
end)
@@ -1988,6 +1987,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()
@@ -3027,11 +3059,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
@@ -3101,7 +3132,6 @@ describe('API', function()
local screen
before_each(function()
clear()
screen = Screen.new(100, 35)
screen:attach()
screen:set_default_attr_ids({