2017-10-05 22:27:10 +08:00
|
|
|
Execute ( SpaceVim api: vim#buffer open ):
|
2017-05-07 23:34:27 +08:00
|
|
|
new
|
|
|
|
let buffer = SpaceVim#api#import('vim#buffer')
|
|
|
|
call buffer.open({'bufname':'foo', 'cmd' : 'setl buftype=nofile bufhidden=wipe'})
|
|
|
|
AssertEqual bufname('%'), 'foo'
|
|
|
|
AssertEqual &buftype, 'nofile'
|
2017-10-05 22:27:10 +08:00
|
|
|
|
|
|
|
Execute ( SpaceVim api: vim#buffer buf_set_lines):
|
|
|
|
let buffer = SpaceVim#api#import('vim#buffer')
|
2017-10-22 22:55:06 +08:00
|
|
|
let os = SpaceVim#api#import('system')
|
|
|
|
if os.isWindows
|
|
|
|
finish
|
|
|
|
endif
|
2017-10-22 22:50:28 +08:00
|
|
|
new
|
2017-10-05 22:27:10 +08:00
|
|
|
let nr = bufnr('%')
|
|
|
|
new
|
|
|
|
call buffer.buf_set_lines(nr, 0, 1, 0, ['line 1', 'line 2', 'line 3'])
|
|
|
|
AssertEqual getbufline(nr, 1, '$'), ['line 1', 'line 2', 'line 3']
|