Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve editor layout
  • Loading branch information
ShMcK committed Sep 30, 2019
commit 3a154817cccf0ea8e2ab63a3847d8334495ef2c3
19 changes: 5 additions & 14 deletions src/editor/ReactWebView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,12 @@ class ReactWebView {
// vscode.commands.executeCommand('coderoad.open_webview')
// }

// // prevents new panels from going on top of coderoad panel
vscode.window.onDidChangeActiveTextEditor((textEditor?: vscode.TextEditor) => {
console.log('onDidChangeActiveTextEditor')
console.log(textEditor)
// if (!textEditor || textEditor.viewColumn !== vscode.ViewColumn.Two) {
// updateWindows()
// }
})
// // // prevents moving coderoad panel on top of left panel
vscode.window.onDidChangeVisibleTextEditors((textEditor: vscode.TextEditor[]) => {
console.log('onDidChangeVisibleTextEditors')
console.log(textEditor)
// updateWindows()
})
// vscode.window.onDidChangeVisibleTextEditors((textEditors: vscode.TextEditor[]) => {
// console.log('onDidChangeVisibleTextEditors')
// console.log(textEditors)
// // updateWindows()
// })

// TODO: prevent window from moving to the left when no windows remain on rights

Expand All @@ -83,7 +75,6 @@ class ReactWebView {
}

public createOrShow(): void {
// reset layout
vscode.commands.executeCommand('vscode.setEditorLayout', {
orientation: 0,
groups: [{groups: [{}], size: 0.6}, {groups: [{}], size: 0.4}],
Expand Down
6 changes: 6 additions & 0 deletions src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class Editor {
console.log('ACTIVATE!')
this.vscodeExt = vscodeExt

// set out 60/40 layout
vscode.commands.executeCommand('vscode.setEditorLayout', {
orientation: 0,
groups: [{groups: [{}], size: 0.6}, {groups: [{}], size: 0.4}],
})

// commands
this.activateCommands()

Expand Down