From f5d5da391715f3b1d4c3d36c522e39b94866b93f Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 4 Mar 2019 17:53:41 +0100 Subject: buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf() --- test/functional/api/vim_spec.lua | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index b10076c6da..75b9fb71c9 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1359,6 +1359,9 @@ describe('API', function() eq({id=1}, meths.get_current_buf()) local screen = Screen.new(20, 4) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + }) screen:attach() -- @@ -1373,7 +1376,7 @@ describe('API', function() end -- - -- Visiting a scratch-buffer DOES change its properties. + -- Visiting a scratch-buffer DOES NOT change its properties. -- meths.set_current_buf(edited_buf) screen:expect([[ @@ -1381,12 +1384,19 @@ describe('API', function() {1:~ }| {1:~ }| | - ]], { - [1] = {bold = true, foreground = Screen.colors.Blue1}, - }) - eq('', meths.buf_get_option(edited_buf, 'buftype')) - eq('', meths.buf_get_option(edited_buf, 'bufhidden')) + ]]) + eq('nofile', meths.buf_get_option(edited_buf, 'buftype')) + eq('hide', meths.buf_get_option(edited_buf, 'bufhidden')) eq(false, meths.buf_get_option(edited_buf, 'swapfile')) + + -- scratch buffer can be wiped without error + command('bwipe') + screen:expect([[ + ^ | + {1:~ }| + {1:~ }| + | + ]]) end) end) end) -- cgit