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