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