本文整理汇总了TypeScript中@chemzqm/neovim.Neovim.command方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Neovim.command方法的具体用法?TypeScript Neovim.command怎么用?TypeScript Neovim.command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.command方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: showBuffer
private showBuffer(): void {
let { window, nvim } = this
nvim.command(`noa call win_gotoid(${this.window.id})`, true)
window.notify('nvim_win_set_cursor', [window, [1, 1]])
this.floatBuffer.setLines()
nvim.command('noa wincmd p', true)
}
示例2: it
it('should watch options', async () => {
let fn = jest.fn()
workspace.watchOption('showmode', fn, disposables)
await helper.wait(150)
await nvim.command('set showmode')
await helper.wait(150)
expect(fn).toBeCalled()
await nvim.command('noa set noshowmode')
})
示例3: reset
public async reset(): Promise<void> {
let mode = await this.nvim.call('mode')
if (mode !== 'n') {
await this.nvim.command('stopinsert')
await this.nvim.call('feedkeys', [String.fromCharCode(27), 'int'])
}
await this.nvim.command('silent! %bwipeout!')
await this.wait(60)
}
示例4: it
it('should activated after cursor moved out and in', async () => {
await manager.start(['--normal', 'location'])
await helper.wait(100)
await nvim.command('wincmd p')
await helper.wait(100)
await nvim.command('wincmd p')
await helper.wait(100)
expect(manager.isActivated).toBe(true)
})
示例5: it
it('should highlight multiple line range', async () => {
await manager.start(['--normal', '--auto-preview', 'location'])
await helper.wait(300)
await nvim.command('exe 3')
let bufnr = await nvim.eval('bufnr("%")')
await events.fire('CursorMoved', [bufnr, [2, 1]])
await helper.wait(300)
await nvim.command('wincmd k')
let matches = await nvim.call('getmatches')
expect(matches.filter(o => o.group == 'Search').length).toBe(2)
})
示例6: it
it('should check signs', async () => {
let buf = await createDiagnosticBuffer()
await nvim.setLine('foo')
await nvim.command(`sign place 1005 line=1 name=CocError buffer=${buf.bufnr}`)
await nvim.command(`sign place 1006 line=1 name=CocError buffer=${buf.bufnr}`)
await buf.checkSigns()
let content = await nvim.call('execute', [`sign place buffer=${buf.bufnr}`])
let lines: string[] = content.split('\n')
let line = lines.find(s => s.indexOf('CocError') != -1)
expect(line).toBeUndefined()
})
示例7: it
it('should works for buffer source', async () => {
await nvim.command('set hidden')
await helper.createDocument()
await helper.createDocument()
await nvim.setLine('other')
await nvim.command('bp')
await helper.wait(100)
let { mode } = await nvim.mode
expect(mode).toBe('n')
await nvim.input('io')
let res = await helper.visible('other', 'buffer')
expect(res).toBe(true)
})
示例8: it
it('should load local extensions', async () => {
let folder = path.resolve(__dirname, '../extensions/local')
await nvim.command(`set runtimepath^=${folder}`)
await helper.wait(200)
let stat = extensions.getExtensionState('local')
expect(stat).toBe('activated')
})