Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8696b5

Browse files
committed
fix window positioning issue
1 parentbb96ab8 commitd8696b5

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

‎src/editor/ReactWebView.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ReactWebView {
1616
this.extensionPath=extensionPath
1717

1818
// Create and show a new webview panel
19-
this.panel=this.createWebviewPanel(vscode.ViewColumn.One)
19+
this.panel=this.createWebviewPanel(vscode.ViewColumn.Two)
2020

2121
// Set the webview's initial html content
2222
this.panel.webview.html=this.getHtmlForWebview()
@@ -28,7 +28,24 @@ class ReactWebView {
2828
// Handle messages from the webview
2929
constonReceive=(action:string|CR.Action)=>vscode.commands.executeCommand('coderoad.receive_action',action)
3030
this.panel.webview.onDidReceiveMessage(onReceive,null,this.disposables)
31-
console.log('webview loaded')
31+
32+
// update panel on changes
33+
constupdateWindows=()=>{
34+
vscode.commands.executeCommand('vscode.setEditorLayout',{orientation:0,groups:[{groups:[{}],size:0.6},{groups:[{}],size:0.4}]})
35+
this.panel.reveal(vscode.ViewColumn.Two)
36+
}
37+
// prevents new panels from going ontop of coderoad panel
38+
vscode.window.onDidChangeActiveTextEditor((param)=>{
39+
if(!param||param.viewColumn!==vscode.ViewColumn.Two){
40+
updateWindows()
41+
}
42+
})
43+
// prevents moving coderoad panel on top of left panel
44+
vscode.window.onDidChangeVisibleTextEditors((param)=>{
45+
updateWindows()
46+
})
47+
48+
// TODO: prevent window from moving to the left when no windows remain on rights
3249
}
3350

3451
publiccreateOrShow(column:number):void{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp