本文整理匯總了TypeScript中@chemzqm/neovim.Neovim.setLine方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Neovim.setLine方法的具體用法?TypeScript Neovim.setLine怎麽用?TypeScript Neovim.setLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.setLine方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should not show word of word source on empty input', async () => {
await helper.edit()
await nvim.setLine('foo bar')
await helper.wait(30)
await nvim.input('of')
await helper.waitPopup()
let res = await helper.visible('foo', 'around')
expect(res).toBe(true)
await nvim.input('<backspace>')
await helper.wait(100)
res = await helper.notVisible('foo')
expect(res).toBe(true)
})
示例2: 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(300)
let { mode } = await nvim.mode
expect(mode).toBe('n')
await nvim.input('io')
let res = await helper.visible('other', 'buffer')
expect(res).toBe(true)
})
示例3: it
it('should adjust float window position', async () => {
await helper.edit()
await nvim.setLine(' '.repeat(70))
await nvim.input('A')
await helper.wait(30)
await nvim.input('f')
await helper.visible('foo', 'float')
await nvim.input('<C-n>')
await helper.wait(200)
let floatWin = await helper.getFloat()
let config = await floatWin.getConfig()
expect(config.col + config.width).toBeLessThan(80)
})
示例4: it
it('should filter and sort on increment search', async () => {
await helper.edit()
await nvim.setLine('forceDocumentSync format fallback')
await helper.wait(30)
await nvim.input('of')
await helper.waitPopup()
let items = await helper.getItems()
let l = items.length
await nvim.input('oa')
await helper.wait(100)
items = await helper.getItems()
expect(items.findIndex(o => o.word == 'fallback')).toBe(-1)
expect(items.length).toBeLessThan(l)
})
示例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')
})
示例6: it
it('should get word range', async () => {
await helper.createDocument()
await nvim.setLine('foo bar')
await helper.wait(30)
let doc = await workspace.document
let range = doc.getWordRangeAtPosition({ line: 0, character: 0 })
expect(range).toEqual(Range.create(0, 0, 0, 3))
range = doc.getWordRangeAtPosition({ line: 0, character: 3 })
expect(range).toBeNull()
range = doc.getWordRangeAtPosition({ line: 0, character: 4 })
expect(range).toEqual(Range.create(0, 4, 0, 7))
range = doc.getWordRangeAtPosition({ line: 0, character: 7 })
expect(range).toBeNull()
})
示例7: it
it('should adjust with line changed before start position', async () => {
let buf = await helper.edit()
await nvim.setLine('abd')
await nvim.input('o')
let session = new SnippetSession(nvim, buf.id)
let res = await session.start('${1:foo}')
await helper.wait(30)
expect(res).toBe(true)
await session.synchronizeUpdatedPlaceholders({
range: Range.create(0, 0, 0, 3),
text: 'def'
})
expect(session.isActive).toBe(true)
})
示例8: it
it('should fix word on CompleteDone', async () => {
await nvim.setLine('fball football')
await nvim.input('i')
await nvim.call('cursor', [1, 2])
let option: CompleteOption = await nvim.call('coc#util#get_complete_option')
await completion.startCompletion(option)
let items = await helper.items()
expect(items.length).toBe(1)
await nvim.input('<C-n>')
await helper.wait(30)
await nvim.call('coc#_select')
await helper.wait(100)
let line = await nvim.line
expect(line).toBe('football football')
})
示例9: it
it('should init vim events', async () => {
let buf = await helper.edit()
await buf.detach()
let attached = buf.isAttached
expect(attached).toBe(false)
let doc = workspace.getDocument(buf.id)
; (doc as any).env.isVim = true
; (workspace as any).initVimEvents()
await nvim.setLine('abc')
await helper.wait(300)
expect(doc.content).toMatch('abc')
await nvim.input('Adef')
await nvim.call('coc#_hide')
await helper.wait(300)
expect(doc.getline(0)).toMatch('abcdef')
})