本文整理匯總了TypeScript中@chemzqm/neovim.Neovim.eval方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Neovim.eval方法的具體用法?TypeScript Neovim.eval怎麽用?TypeScript Neovim.eval使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.eval方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should not trigger when cursor moved', async () => {
await helper.edit()
let source: ISource = {
name: 'trigger',
priority: 10,
enable: true,
sourceType: SourceType.Native,
triggerCharacters: ['.'],
doComplete: async (): Promise<CompleteResult> => {
return Promise.resolve({
items: [{ word: 'foo' }]
})
}
}
sources.addSource(source)
await nvim.setLine('.a')
await nvim.input('A')
await nvim.eval('feedkeys("\\<bs>")')
await helper.wait(10)
await nvim.eval('feedkeys("\\<left>")')
await helper.wait(200)
let visible = await nvim.call('pumvisible')
expect(visible).toBe(0)
sources.removeSource(source)
})
示例2: it
it('should change next/previous keymap', async () => {
helper.updateConfiguration('list.nextKeymap', '<tab>')
helper.updateConfiguration('list.previousKeymap', '<s-tab>')
await manager.start(['location'])
await helper.wait(100)
await nvim.eval('feedkeys("\\<tab>", "in")')
await helper.wait(100)
let line = await nvim.line
expect(line).toMatch('Bar')
await nvim.eval('feedkeys("\\<s-tab>", "in")')
await helper.wait(100)
line = await nvim.line
expect(line).toMatch('foo')
})
示例3: it
it('should highlight ranges', async () => {
await manager.start(['--normal', '--auto-preview', 'location'])
await helper.wait(300)
await nvim.command('wincmd k')
let name = await nvim.eval('bufname("%")')
expect(name).toMatch(__filename)
let matches = await nvim.call('getmatches')
let find = matches.find(o => o.group == 'Search')
expect(find).toBeDefined()
})
示例4: it
it('should rename buffer', async () => {
await nvim.command('edit a')
await helper.wait(100)
let p = workspace.renameCurrent()
await helper.wait(100)
await nvim.input('<backspace>b<cr>')
await p
let name = await nvim.eval('bufname("%")') as string
expect(name.endsWith('b')).toBe(true)
})
示例5: it
it('should select choice placeholder', async () => {
let buf = await helper.edit()
let session = new SnippetSession(nvim, buf.id)
await nvim.input('i')
await session.start('${1|one,two,three|}')
await helper.wait(60)
let line = await nvim.line
expect(line).toBe('one')
let val = await nvim.eval('g:coc#_context') as any
expect(val.start).toBe(0)
expect(val.candidates).toEqual(['one', 'two', 'three'])
})