mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
file tab switches only
This commit is contained in:
parent
6868a8b1d8
commit
a69b99b562
1 changed files with 3 additions and 2 deletions
|
|
@ -241,8 +241,9 @@ export class TabSwitchListener extends Disposable {
|
|||
// when editor switches tabs (models)
|
||||
const addTabSwitchListeners = (editor: ICodeEditor) => {
|
||||
this._register(editor.onDidChangeModel(e => {
|
||||
if (e.newModelUrl)
|
||||
if (e.newModelUrl && e.newModelUrl.scheme === 'file') {
|
||||
onSwitchTab(e.newModelUrl)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +285,7 @@ class TabSwitchContribution extends Disposable implements IWorkbenchContribution
|
|||
// run on current tab if it exists, and listen for tab switches and visibility changes
|
||||
addCurrentFileIfVisible()
|
||||
this._register(this.viewsService.onDidChangeViewVisibility(() => { addCurrentFileIfVisible() }))
|
||||
this.instantiationService.createInstance(TabSwitchListener, () => { addCurrentFileIfVisible() })
|
||||
this._register(this.instantiationService.createInstance(TabSwitchListener, () => { addCurrentFileIfVisible() }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue