当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Neovim.pauseNotification方法代码示例

本文整理汇总了TypeScript中@chemzqm/neovim.Neovim.pauseNotification方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Neovim.pauseNotification方法的具体用法?TypeScript Neovim.pauseNotification怎么用?TypeScript Neovim.pauseNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@chemzqm/neovim.Neovim的用法示例。


在下文中一共展示了Neovim.pauseNotification方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

 it('should add matches to ranges', async () => {
   let doc = await helper.createDocument()
   let buf = doc.buffer
   let lines = [
     'a'.repeat(30),
     'b'.repeat(30),
     'c'.repeat(30),
     'd'.repeat(30)
   ]
   await buf.setLines(lines, { start: 0, end: -1 })
   await helper.wait(100)
   let ranges: Range[] = [
     Range.create(0, 0, 0, 10),
     Range.create(1, 0, 2, 10),
     Range.create(3, 0, 4, 0)]
   nvim.pauseNotification()
   doc.matchAddRanges(ranges, 'Search')
   await nvim.resumeNotification()
   let res = await nvim.call('getmatches')
   let item = res.find(o => o.group == 'Search')
   expect(item).toBeDefined()
   expect(item.pos1).toEqual([1, 1, 10])
   expect(item.pos2).toEqual([2, 1, 30])
   expect(item.pos3).toEqual([3, 1, 10])
   expect(item.pos4).toEqual([4, 1, 30])
 })
开发者ID:illarionvk,项目名称:dotfiles,代码行数:26,代码来源:document.test.ts

示例2: start

 public async start(cwd?: string, env?: { [key: string]: string | null }): Promise<void> {
   let { nvim } = this
   nvim.pauseNotification()
   nvim.command('belowright 5new', true)
   nvim.command('setl winfixheight', true)
   nvim.command('setl norelativenumber', true)
   nvim.command('setl nonumber', true)
   if (env && Object.keys(env).length) {
     for (let key of Object.keys(env)) {
       nvim.command(`let $${key}='${env[key].replace(/'/g, "''")}'`, true)
     }
   }
   await nvim.resumeNotification()
   this.bufnr = await nvim.call('bufnr', '%')
   let cmd = [this.cmd, ...this.args]
   let opts: any = {}
   if (cwd) opts.cwd = cwd
   this.chanId = await nvim.call('termopen', [cmd, opts])
   if (env && Object.keys(env).length) {
     for (let key of Object.keys(env)) {
       nvim.command(`unlet $${key}`, true)
     }
   }
   await nvim.command('wincmd p')
 }
开发者ID:illarionvk,项目名称:dotfiles,代码行数:25,代码来源:terminal.ts

示例3: show

 public async show(docs: Documentation[], bounding: PumBounding, token: CancellationToken): Promise<void> {
   this.bounding = bounding
   let { nvim } = this
   let rect = await this.calculateBounding(docs)
   if (this.window) {
     let valid = await this.window.valid
     if (!valid) this.window = null
   }
   if (token.isCancellationRequested) return
   if (!this.window) {
     try {
       let config = Object.assign({
         relative: 'editor',
         focusable: true
       }, rect)
       let win = this.window = await nvim.openFloatWindow(this.buffer, false, config)
       nvim.pauseNotification()
       win.setVar('popup', 1, true)
       win.setVar('float', 1, true)
       win.setOption('list', false, true)
       win.setOption('spell', false, true)
       win.setOption('listchars', 'eol: ', true)
       win.setOption('number', false, true)
       win.setOption('cursorline', false, true)
       win.setOption('cursorcolumn', false, true)
       win.setOption('signcolumn', 'no', true)
       win.setOption('conceallevel', 2, true)
       win.setOption('relativenumber', false, true)
       win.setOption('winhl', 'Normal:CocFloating,NormalNC:CocFloating', true)
       this.showBuffer()
       await nvim.resumeNotification()
     } catch (e) {
       logger.error(`Create preview error:`, e.stack)
     }
   } else {
     nvim.pauseNotification()
     let config = Object.assign({
       relative: 'editor'
     }, rect)
     this.window.setConfig(config, true)
     this.showBuffer()
     await nvim.resumeNotification()
   }
   if (token.isCancellationRequested) {
     nvim.call('coc#util#close_win', [this.window.id], true)
   }
 }
开发者ID:illarionvk,项目名称:dotfiles,代码行数:47,代码来源:floating.ts

示例4: it

 it('should set documents', async () => {
   let buf = await create()
   let docs: Documentation[] = [{
     filetype: 'markdown',
     content: '# head\n**note**'
   }, {
     filetype: 'typescript',
     content: "class Foo",
     active: [0, 5]
   }]
   await buf.setDocuments(docs, 60)
   nvim.pauseNotification()
   buf.setLines()
   await nvim.resumeNotification()
   let lines = await buf.buffer.lines
   expect(lines.length).toBe(4)
 })
开发者ID:illarionvk,项目名称:dotfiles,代码行数:17,代码来源:floatBuffer.test.ts

示例5: show

  public async show(preserveFocus?: boolean): Promise<void> {
    let { bufnr, nvim } = this
    if (!bufnr) return
    let winnr = await nvim.call('bufwinnr', bufnr)
    nvim.pauseNotification()
    if (winnr == -1) {
      nvim.command(`below ${bufnr}sb`, true)
      nvim.command('resize 5', true)
    } else {
      nvim.command(`${winnr}wincmd w`, true)
    }
    nvim.command('normal! G', true)
    if (preserveFocus) {
      nvim.command('wincmd p', true)
    }
    await nvim.resumeNotification()

  }
开发者ID:illarionvk,项目名称:dotfiles,代码行数:18,代码来源:terminal.ts


注:本文中的@chemzqm/neovim.Neovim.pauseNotification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。