@@ -81,14 +81,18 @@ export class ProjectWebviewProviderState<ProviderT extends ProjectWebviewProvide
8181 this . _panel = vscode . window . createWebviewPanel (
8282 this . _provider . scheme ( ) ,
8383 log . Extension . displayName ,
84- columnToShowIn ,
84+ {
85+ viewColumn : columnToShowIn ,
86+ preserveFocus : true ,
87+ } ,
8588 {
8689 enableCommandUris : true ,
8790 enableScripts : true ,
8891 enableFindWidget : true ,
8992 }
9093 ) ;
9194 this . _panel . onDidDispose ( ( ) => {
95+ this . active = false ;
9296 this . _hasPanel = false ;
9397 this . _onDidDisposeContent . fire ( ) ;
9498 } , null , this . disposables ) ;
@@ -106,12 +110,14 @@ export class ProjectWebviewProviderState<ProviderT extends ProjectWebviewProvide
106110}
107111
108112export abstract class ProjectWebviewProvider implements ProjectContentProvider {
109- protected readonly _disposables : vscode . Disposable [ ] ;
113+ protected readonly _disposables : vscode . Disposable [ ] = [ ] ;
110114
111115 protected _onDidAriseInternalError = new vscode . EventEmitter < Error > ( ) ;
112116 readonly onDidAriseInternalError = this . _onDidAriseInternalError . event ;
113117
114118 dispose ( ) { this . _disposables . forEach ( d => d . dispose ( ) ) ; }
119+ clear ( project : Project ) { }
120+
115121
116122 /**
117123 * Return a new description of a project content provider state.
@@ -133,7 +139,8 @@ export abstract class ProjectWebviewProvider implements ProjectContentProvider{
133139 let panel = state . panel ;
134140 panel . title = `${ log . Extension . displayName } | ${ project . prjname } ` ;
135141 panel . webview . html = data ;
136- panel . reveal ( ) ;
142+ if ( project . focus == state )
143+ panel . reveal ( ) ;
137144 } , data => {
138145 this . _onDidAriseInternalError . fire ( new Error ( data ) ) ;
139146 vscode . window . showErrorMessage ( log . Extension . displayName +
0 commit comments