本文整理汇总了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)
})