diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-03-04 17:53:41 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-03-05 15:05:23 +0100 |
commit | f5d5da391715f3b1d4c3d36c522e39b94866b93f (patch) | |
tree | 33fb008f256d8974bfb7cd0cc942656c5bc88181 /test/functional/api/vim_spec.lua | |
parent | 2816bc8620ca373145842641ce77805f4321b2bc (diff) | |
download | rneovim-f5d5da391715f3b1d4c3d36c522e39b94866b93f.tar.gz rneovim-f5d5da391715f3b1d4c3d36c522e39b94866b93f.tar.bz2 rneovim-f5d5da391715f3b1d4c3d36c522e39b94866b93f.zip |
buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf()
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 22 |
1 files changed, 16 insertions, 6 deletions
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) |