本文整理匯總了TypeScript中@chemzqm/neovim.Neovim.openFloatWindow方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Neovim.openFloatWindow方法的具體用法?TypeScript Neovim.openFloatWindow怎麽用?TypeScript Neovim.openFloatWindow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@chemzqm/neovim.Neovim
的用法示例。
在下文中一共展示了Neovim.openFloatWindow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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)
}
}