aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-28 12:18:04 +0200
committerGitHub <noreply@github.com>2022-05-28 12:18:04 +0200
commit0dd3798dbb3fdc058b69262bf2deb56917e701fd (patch)
tree74ca56c3a5f2a2cf5f695b0c9c85495aa452896a /test
parent1b235fe6cab237e3cb78a44ee82ab79a85370f98 (diff)
parent9cf1ac037749bf3e32455627071cad4f83e5f6b7 (diff)
downloadrneovim-0dd3798dbb3fdc058b69262bf2deb56917e701fd.tar.gz
rneovim-0dd3798dbb3fdc058b69262bf2deb56917e701fd.tar.bz2
rneovim-0dd3798dbb3fdc058b69262bf2deb56917e701fd.zip
Merge pull request #18776 from famiu/fix/winbar_noroom
fix(winbar): only allow adding winbar when there is space
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/winbar_spec.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index 476da0d19f..982d2d67fd 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -7,6 +7,7 @@ local meths = helpers.meths
local eq = helpers.eq
local poke_eventloop = helpers.poke_eventloop
local feed = helpers.feed
+local pcall_err = helpers.pcall_err
describe('winbar', function()
local screen
@@ -28,6 +29,7 @@ describe('winbar', function()
})
meths.set_option('winbar', 'Set Up The Bars')
end)
+
it('works', function()
screen:expect([[
{1:Set Up The Bars }|
@@ -45,6 +47,7 @@ describe('winbar', function()
|
]])
end)
+
it('works with custom \'fillchars\' value', function()
command('set fillchars=wbr:+')
screen:expect([[
@@ -63,6 +66,7 @@ describe('winbar', function()
|
]])
end)
+
it('works with custom highlight', function()
command('hi WinBar guifg=red')
screen:expect([[
@@ -81,6 +85,7 @@ describe('winbar', function()
|
]])
end)
+
it('works with splits', function()
command('hi WinBar guifg=red')
command('hi WinBarNC guifg=blue')
@@ -101,6 +106,7 @@ describe('winbar', function()
|
]])
end)
+
it('works when switching value of \'winbar\'', function()
command('belowright vsplit | split | split | set winbar=')
screen:expect([[
@@ -151,6 +157,7 @@ describe('winbar', function()
|
]])
end)
+
it('can be ruler', function()
insert [[
just some
@@ -204,6 +211,7 @@ describe('winbar', function()
|
]]}
end)
+
it('works with laststatus=3', function()
command('set laststatus=3')
screen:expect([[
@@ -495,4 +503,59 @@ describe('winbar', function()
|
]])
end)
+
+ it('properly resizes window when there is no space in it', function()
+ command('set winbar= | 1split')
+ screen:expect([[
+ ^ |
+ {4:[No Name] }|
+ |
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {2:[No Name] }|
+ |
+ ]])
+ command('set winbar=a')
+ screen:expect([[
+ {1:a }|
+ ^ |
+ {4:[No Name] }|
+ {1:a }|
+ |
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {3:~ }|
+ {2:[No Name] }|
+ |
+ ]])
+ end)
+
+ it('cannot be added unless there is room', function()
+ command('set winbar= | split | split | split | split | split')
+ screen:expect([[
+ ^ |
+ {4:[No Name] }|
+ |
+ {2:[No Name] }|
+ |
+ {2:[No Name] }|
+ |
+ {2:[No Name] }|
+ |
+ {2:[No Name] }|
+ |
+ {2:[No Name] }|
+ |
+ ]])
+ eq('Vim(set):E36: Not enough room', pcall_err(command, 'set winbar=test'))
+ end)
end)