File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,24 @@ export class TableView {
167167 // add it to the tracked table webviews
168168 TableView . _views . set ( this . viewUri . toString ( true ) , this ) ;
169169
170+ // update tablew view context values on webview state change
171+ this . _webviewPanel . onDidChangeViewState (
172+ ( viewChangeEvent : WebviewPanelOnDidChangeViewStateEvent ) => {
173+ if ( this . _webviewPanel . active ) {
174+ // update table view context values
175+ commands . executeCommand ( ViewCommands . setContext , ViewContexts . tableViewVisible , true ) ;
176+ commands . executeCommand ( ViewCommands . setContext , ViewContexts . tabularDataUri , documentUri ) ;
177+ statusBar . showFileStats ( this . _fileInfo ) ;
178+ TableView . currentView = this ;
179+ }
180+ else {
181+ // clear and hide current table view stats display
182+ statusBar . hide ( ) ;
183+ commands . executeCommand ( ViewCommands . setContext , ViewContexts . tableViewVisible , false ) ;
184+ TableView . currentView = undefined ;
185+ }
186+ } ) ;
187+
170188 // dispose table view resources when table view panel is closed by the user or via vscode apis
171189 this . _webviewPanel . onDidDispose ( this . dispose , this , this . _disposables ) ;
172190 }
You can’t perform that action at this time.
0 commit comments