Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(extension): allow CocUpdate UI open in tab #5050

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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