2016-04-23 16:53:11 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2016-03-12 21:13:31 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2018-09-23 01:11:56 -07:00
|
|
|
local clear = helpers.clear
|
|
|
|
local command = helpers.command
|
|
|
|
local eq = helpers.eq
|
|
|
|
local eval = helpers.eval
|
|
|
|
local feed = helpers.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([[
|
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
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([[
|
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
: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([[
|
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
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([[
|
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
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([[
|
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
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
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
: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
|
|
|
^ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
: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)
|