aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-12 05:39:33 +0800
committerGitHub <noreply@github.com>2024-05-12 05:39:33 +0800
commit4e5c633ed4871a948aff7338b793ac5f93484153 (patch)
tree744f6ad0ea34f49e17a5ffae6ae3e335de86559d /test
parentc1396afa7c41c2009d06a54c8aaf1ca5689a9786 (diff)
downloadrneovim-4e5c633ed4871a948aff7338b793ac5f93484153.tar.gz
rneovim-4e5c633ed4871a948aff7338b793ac5f93484153.tar.bz2
rneovim-4e5c633ed4871a948aff7338b793ac5f93484153.zip
fix(api): make getting explicit empty hl in virtual text work (#28697)
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/extmark_spec.lua4
-rw-r--r--test/functional/ui/float_spec.lua42
2 files changed, 44 insertions, 2 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index 965a60417a..5ab3e09bf8 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -1569,7 +1569,7 @@ describe('API/extmarks', function()
sign_text = '>>',
spell = true,
virt_lines = {
- { { 'lines', 'Macro' }, { '???' } },
+ { { 'lines', 'Macro' }, { '???' }, { ';;;', '' } },
{ { 'stack', { 'Type', 'Search' } }, { '!!!' } },
},
virt_lines_above = true,
@@ -1604,7 +1604,7 @@ describe('API/extmarks', function()
sign_text = '>>',
spell = true,
virt_lines = {
- { { 'lines', 'Macro' }, { '???' } },
+ { { 'lines', 'Macro' }, { '???' }, { ';;;', '' } },
{ { 'stack', { 'Type', 'Search' } }, { '!!!' } },
},
virt_lines_above = true,
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 131cc15bfb..248220e28b 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -2407,6 +2407,7 @@ describe('float window', function()
command('hi B0 guibg=Red guifg=Black')
command('hi B1 guifg=White')
+
api.nvim_win_set_config(win, {
title = {{"🦄"}, {"BB", {"B0", "B1"}}}, title_pos = "right",
footer= {{"🦄"}, {"BB", {"B0", "B1"}}}, footer_pos = "right",
@@ -2443,6 +2444,47 @@ describe('float window', function()
|
]]}
end
+ eq({{"🦄"}, {"BB", {"B0", "B1"}}}, api.nvim_win_get_config(win).title)
+ eq({{"🦄"}, {"BB", {"B0", "B1"}}}, api.nvim_win_get_config(win).footer)
+
+ api.nvim_win_set_config(win, {
+ title = {{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, title_pos = "left",
+ footer= {{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, footer_pos = "left",
+ })
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:----------------------------------------]|*6
+ [3:----------------------------------------]|
+ ## grid 2
+ ^ |
+ {0:~ }|*5
+ ## grid 3
+ |
+ ## grid 4
+ {5:╔}🦄{7:BB}{5:═════╗}|
+ {5:║}{1: halloj! }{5:║}|
+ {5:║}{1: BORDAA }{5:║}|
+ {5:╚}🦄{7:BB}{5:═════╝}|
+ ]], float_pos={
+ [4] = { 1001, "NW", 1, 2, 5, true }
+ }, win_viewport={
+ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [4] = {win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ ^ |
+ {0:~ }|
+ {0:~ }{5:╔}🦄{7:BB}{5:═════╗}{0: }|
+ {0:~ }{5:║}{1: halloj! }{5:║}{0: }|
+ {0:~ }{5:║}{1: BORDAA }{5:║}{0: }|
+ {0:~ }{5:╚}🦄{7:BB}{5:═════╝}{0: }|
+ |
+ ]]}
+ end
+ eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).title)
+ eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).footer)
end)
it('terminates border on edge of viewport when window extends past viewport', function()