2024-04-09 04:26:16 -07:00
|
|
|
local t = require('test.functional.testutil')()
|
2016-03-12 21:13:31 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2024-04-08 02:03:20 -07:00
|
|
|
local clear = t.clear
|
|
|
|
local command = t.command
|
|
|
|
local eq = t.eq
|
|
|
|
local eval = t.eval
|
|
|
|
local feed = t.feed
|
2016-03-12 21:13:31 -07:00
|
|
|
|
|
|
|
describe("'shortmess'", function()
|
|
|
|
local screen
|
|
|
|
|
|
|
|
before_each(function()
|
|
|
|
clear()
|
2018-09-23 01:11:56 -07:00
|
|
|
screen = Screen.new(42, 5)
|
2016-03-12 21:13:31 -07:00
|
|
|
screen:attach()
|
|
|
|
end)
|
|
|
|
|
2016-03-16 21:21:48 -07:00
|
|
|
describe('"F" flag', function()
|
2018-09-23 01:11:56 -07:00
|
|
|
it('hides :edit fileinfo messages', function()
|
|
|
|
command('set hidden')
|
|
|
|
command('set shortmess-=F')
|
|
|
|
feed(':edit foo<CR>')
|
|
|
|
screen:expect([[
|
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2020-06-12 17:26:04 -07:00
|
|
|
"foo" [New] |
|
2018-09-23 01:11:56 -07:00
|
|
|
]])
|
|
|
|
eq(1, eval('bufnr("%")'))
|
|
|
|
|
|
|
|
command('set shortmess+=F')
|
|
|
|
feed(':edit bar<CR>')
|
|
|
|
screen:expect([[
|
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2018-09-23 01:11:56 -07:00
|
|
|
:edit bar |
|
|
|
|
]])
|
|
|
|
eq(2, eval('bufnr("%")'))
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('hides :bnext, :bprevious fileinfo messages', function()
|
|
|
|
command('set hidden')
|
|
|
|
command('set shortmess-=F')
|
|
|
|
feed(':edit foo<CR>')
|
|
|
|
screen:expect([[
|
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2020-06-12 17:26:04 -07:00
|
|
|
"foo" [New] |
|
2018-09-23 01:11:56 -07:00
|
|
|
]])
|
|
|
|
eq(1, eval('bufnr("%")'))
|
|
|
|
feed(':edit bar<CR>')
|
|
|
|
screen:expect([[
|
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2020-06-12 17:26:04 -07:00
|
|
|
"bar" [New] |
|
2018-09-23 01:11:56 -07:00
|
|
|
]])
|
|
|
|
eq(2, eval('bufnr("%")'))
|
|
|
|
feed(':bprevious<CR>')
|
|
|
|
screen:expect([[
|
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2020-06-12 17:26:04 -07:00
|
|
|
"foo" [New] --No lines in buffer-- |
|
2018-09-23 01:11:56 -07:00
|
|
|
]])
|
|
|
|
eq(1, eval('bufnr("%")'))
|
|
|
|
|
|
|
|
command('set shortmess+=F')
|
|
|
|
feed(':bnext<CR>')
|
2016-03-12 21:13:31 -07:00
|
|
|
screen:expect([[
|
2018-09-23 01:11:56 -07:00
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2018-09-23 01:11:56 -07:00
|
|
|
:bnext |
|
2016-03-12 21:13:31 -07:00
|
|
|
]])
|
2018-09-23 01:11:56 -07:00
|
|
|
eq(2, eval('bufnr("%")'))
|
|
|
|
feed(':bprevious<CR>')
|
2016-03-12 21:13:31 -07:00
|
|
|
screen:expect([[
|
2018-09-23 01:11:56 -07:00
|
|
|
^ |
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*3
|
2018-09-23 01:11:56 -07:00
|
|
|
:bprevious |
|
2016-03-12 21:13:31 -07:00
|
|
|
]])
|
2018-09-23 01:11:56 -07:00
|
|
|
eq(1, eval('bufnr("%")'))
|
2016-03-12 21:13:31 -07:00
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|