本文整理汇总了TypeScript中@chemzqm/neovim.Neovim.getLine方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Neovim.getLine方法的具体用法?TypeScript Neovim.getLine怎么用?TypeScript Neovim.getLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.getLine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should be activated', async () => {
await manager.start(['location'])
expect(manager.isActivated).toBe(true)
expect(manager.name).toBe('location')
await helper.wait(500)
let line = await nvim.getLine()
expect(line).toMatch(/manager.test.ts/)
})
示例2: it
it('should start with nest snippet', async () => {
let buf = await helper.edit()
let session = new SnippetSession(nvim, buf.id)
let res = await session.start('${1:a} ${2:b}', false)
let line = await nvim.getLine()
expect(line).toBe('a b')
expect(res).toBe(true)
let { placeholder } = session
expect(placeholder.index).toBe(1)
res = await session.start('${1:foo} ${2:bar}')
expect(res).toBe(true)
placeholder = session.placeholder
let { snippet } = session
expect(placeholder.index).toBe(2)
line = await nvim.getLine()
expect(line).toBe('foo bara b')
expect(snippet.toString()).toBe('foo bara b')
})
示例3: it
it('should pickColor', async () => {
await helper.mockFunction('coc#util#pick_color', [0, 0, 0])
let doc = await helper.createDocument()
await nvim.setLine('#ffffff')
await colors.highlightColors(doc)
await colors.pickColor()
let line = await nvim.getLine()
expect(line).toBe('#000000')
})
示例4: it
it('should apply edits with changes to buffer', async () => {
let doc = await helper.createDocument()
let changes = {
[doc.uri]: [TextEdit.insert(Position.create(0, 0), 'bar')]
}
let workspaceEdit: WorkspaceEdit = { changes }
let res = await workspace.applyEdit(workspaceEdit)
expect(res).toBe(true)
let line = await nvim.getLine()
expect(line).toBe('bar')
})
示例5: it
it('should start new session if session exists', async () => {
await helper.createDocument()
await nvim.setLine('bar')
await snippetManager.insertSnippet('${1:foo} ')
await helper.wait(100)
await nvim.input('<esc>')
await nvim.command('stopinsert')
await nvim.input('A')
await helper.wait(100)
let active = await snippetManager.insertSnippet('${2:bar}')
expect(active).toBe(true)
let line = await nvim.getLine()
expect(line).toBe('foo barbar')
})