mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 19:30:04 +08:00
20 lines
693 B
Plaintext
20 lines
693 B
Plaintext
Execute ( SpaceVim api: vim#buffer open ):
|
|
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'
|
|
|
|
Execute ( SpaceVim api: vim#buffer buf_set_lines):
|
|
Log "setbuflin: " . exists('*setbufline')
|
|
Log "has py: " . has('python')
|
|
Log "has py3: " . has('python3')
|
|
let buffer = SpaceVim#api#import('vim#buffer')
|
|
new
|
|
let nr = bufnr('%')
|
|
new
|
|
let cb = bufnr('%')
|
|
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']
|
|
Log getbufline(cb, 1, '$')
|