Skip to content

Commit

Permalink
feat(extension): allow CocUpdate UI open in tab
Browse files Browse the repository at this point in the history
`coc.preferences.extensionUpdateUIInTab`

Closes #5045
  • Loading branch information
fannheyward committed Jun 20, 2024
1 parent 3a0980f commit f4bf903
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions data/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@
"description": "Interval for check extension update, could be daily, weekly, never",
"enum": ["daily", "weekly", "never"]
},
"coc.preferences.extensionUpdateUIInTab": {
"type": "boolean",
"scope": "application",
"default": false,
"description": "Display extension updating UI in vim tab"
},
"coc.preferences.floatActions": {
"type": "boolean",
"scope": "application",
Expand Down
4 changes: 4 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2024-06-20

- Added `coc.preferences.extensionUpdateUIInTab` to open `CocUpdate` UI in tab

# 2024-05-29

- Break change: increase minimum vim/nvim version requirement
Expand Down
3 changes: 2 additions & 1 deletion src/extension/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ export class InstallBuffer implements InstallUI {
private async show(): Promise<void> {
let isSync = events.requesting === true
let { nvim } = workspace
const useTab = workspace.getConfiguration('coc.preferences').get('extensionUpdateUIInTab', false)
nvim.pauseNotification()
nvim.command(isSync ? 'enew' : 'vs +enew', true)
nvim.command(isSync ? 'enew' : (useTab ? 'tabnew' : 'vs +enew'), true)
nvim.call('bufnr', ['%'], true)
nvim.command('setl buftype=nofile bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1', true)
if (!isSync) nvim.command('nnoremap <silent><nowait><buffer> q :q<CR>', true)
Expand Down

0 comments on commit f4bf903

Please sign in to comment.