float: add "solid" border style (#14310)

It looks solid with the default `FloatBorder` group.

If you set the bgcolor of FloatBorder to the same color as for FloatNormal, you
effectively get an "1-cell padding".
This commit is contained in:
Marco Hinz 2021-04-12 20:51:05 +02:00 committed by GitHub
parent 3893027200
commit 4a36ec6da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 0 deletions

View File

@ -1765,6 +1765,7 @@ static void parse_border_style(Object style, FloatConfig *fconfig, Error *err)
{ "double", { "", "", "", "", "", "", "", "" }, false }, { "double", { "", "", "", "", "", "", "", "" }, false },
{ "single", { "", "", "", "", "", "", "", "" }, false }, { "single", { "", "", "", "", "", "", "", "" }, false },
{ "shadow", { "", "", " ", " ", " ", " ", " ", "" }, true }, { "shadow", { "", "", " ", " ", " ", " ", " ", "" }, true },
{ "solid", { " ", " ", " ", " ", " ", " ", " ", " " }, false },
{ NULL, { { NUL } } , false }, { NULL, { { NUL } } , false },
}; };

View File

@ -690,6 +690,49 @@ describe('float window', function()
]]} ]]}
end end
meths.win_set_config(win, {border="solid"})
if multigrid then
screen:expect{grid=[[
## grid 1
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[2:----------------------------------------]|
[3:----------------------------------------]|
## grid 2
^ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
## grid 3
|
## grid 5
{5: }|
{5: }{1: halloj! }{5: }|
{5: }{1: BORDAA }{5: }|
{5: }|
]], float_pos={
[5] = { { id = 1002 }, "NW", 1, 2, 5, true }
}, win_viewport={
[2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0};
[5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0};
}}
else
screen:expect{grid=[[
^ |
{0:~ }|
{0:~ }{5: }{0: }|
{0:~ }{5: }{1: halloj! }{5: }{0: }|
{0:~ }{5: }{1: BORDAA }{5: }{0: }|
{0:~ }{5: }{0: }|
|
]]}
end
-- support: ascii char, UTF-8 char, composed char, highlight per char -- support: ascii char, UTF-8 char, composed char, highlight per char
meths.win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}}) meths.win_set_config(win, {border={"x", {"å", "ErrorMsg"}, {"\\"}, {"n̈̊", "Search"}}})
if multigrid then if multigrid then