2024-04-20 08:44:13 -07:00
|
|
|
local t = require('test.testutil')
|
|
|
|
local n = require('test.functional.testnvim')()
|
2016-03-12 21:13:31 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2024-04-20 08:44:13 -07:00
|
|
|
|
|
|
|
local clear = n.clear
|
|
|
|
local command = n.command
|
2024-04-08 02:03:20 -07:00
|
|
|
local eq = t.eq
|
2024-04-20 08:44:13 -07:00
|
|
|
local eval = n.eval
|
|
|
|
local feed = n.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
|
|
|
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)
|