1+ import * as fs from "fs-extra" ;
2+ import { ObjectMap } from "pontx-spec" ;
13import * as vscode from "vscode" ;
2- import { htmlTemplate } from "./utils" ;
3- import * as path from "path" ;
44import { alicloudAPIMessageService } from "./Service" ;
5- import { ObjectMap } from "pontx-spec" ;
6- import * as fs from "fs-extra" ;
5+ import { htmlTemplate } from "./utils" ;
76export type PanelConfig = {
87 specName : string ;
98 modName : string ;
@@ -47,13 +46,13 @@ export class AlicloudAPIWebview {
4746 openTab ( extensionUri : vscode . Uri , panelConfig : PanelConfig ) {
4847 const panelKey = getPanelKey ( panelConfig ) ;
4948 const activeEditor = vscode . window . activeTextEditor ;
50- const getViewColumn = ( ) => {
49+ const getViewColumn = ( ) => {
5150 if ( activeEditor && vscode . window . visibleTextEditors . length > 1 ) {
5251 return activeEditor . viewColumn ;
5352 } else {
54- return vscode . ViewColumn . Two ;
53+ return activeEditor ? vscode . ViewColumn . Two : vscode . ViewColumn . Active ;
5554 }
56- }
55+ } ;
5756 const column = getViewColumn ( ) ;
5857
5958 let webview = AlicloudAPIWebview . webviewPanels [ panelKey ] ;
@@ -71,7 +70,7 @@ export class AlicloudAPIWebview {
7170 {
7271 // Enable javascript in the webview
7372 enableScripts : true ,
74- retainContextWhenHidden : true
73+ retainContextWhenHidden : true ,
7574 } ,
7675 ) ;
7776 webview = AlicloudAPIWebview . webviewPanels [ panelKey ] ;
@@ -121,7 +120,7 @@ export class AlicloudAPIWebview {
121120 {
122121 // Enable javascript in the webview
123122 enableScripts : true ,
124- retainContextWhenHidden : true
123+ retainContextWhenHidden : true ,
125124 } ,
126125 ) ;
127126 const filewatcher = vscode . workspace . createFileSystemWatcher ( filePath , true , false , true ) ;
0 commit comments