本文整理匯總了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')
})