本文整理匯總了TypeScript中@chemzqm/neovim.Neovim.createBuffer方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Neovim.createBuffer方法的具體用法?TypeScript Neovim.createBuffer怎麽用?TypeScript Neovim.createBuffer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.createBuffer方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should send text', async () => {
terminal.sendText('ls')
await helper.wait(100)
let buf = nvim.createBuffer(terminal.bufnr)
let lines = await buf.lines
expect(lines.join('\n')).toMatch('vimrc')
})
示例2: edit
public async edit(file?: string): Promise<Buffer> {
file = path.join(__dirname, file ? file : `${uuid()}`)
let escaped = await this.nvim.call('fnameescape', file)
await this.nvim.command(`edit ${escaped}`)
await this.wait(60)
let bufnr = await this.nvim.call('bufnr', ['%']) as number
return this.nvim.createBuffer(bufnr)
}
示例3: it
it('should show floating window on cursor hold', async () => {
let config = workspace.getConfiguration('diagnostic')
config.update('messageTarget', 'float')
await createDocument()
await nvim.call('cursor', [1, 3])
let winid = await helper.waitFloat()
let bufnr = await nvim.call('nvim_win_get_buf', winid) as number
let buf = nvim.createBuffer(bufnr)
let lines = await buf.lines
expect(lines.join('\n')).toMatch('error')
})
示例4: it
it('should respect auto preview option', async () => {
await manager.start(['--auto-preview', 'location'])
expect(manager.isActivated).toBe(true)
await helper.wait(300)
let previewWinnr = await nvim.call('coc#util#has_preview')
expect(previewWinnr).toBe(2)
let bufnr = await nvim.call('winbufnr', previewWinnr)
let buf = nvim.createBuffer(bufnr)
let name = await buf.name
expect(name).toMatch('manager.test.ts')
await nvim.eval('feedkeys("j", "in")')
await helper.wait(100)
let winnr = await nvim.call('coc#util#has_preview')
expect(winnr).toBe(previewWinnr)
})