Skip to content

Commit 692acd0

Browse files
committed
Ensuring right webviewPanel and commands
1 parent 899178d commit 692acd0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@
106106
{
107107
"command": "resx-editor.deleteResource",
108108
"when": "false"
109+
},
110+
{
111+
"command": "resx-editor.addNewResource",
112+
"when": "activeCustomEditorId == 'resx-editor.editor'"
109113
}
110114
]
111115
},
@@ -151,4 +155,4 @@
151155
"@vscode/webview-ui-toolkit": "^1.2.2",
152156
"resx": "^2.0.4"
153157
}
154-
}
158+
}

src/resxProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export class ResxProvider implements vscode.CustomTextEditorProvider {
3232
localResourceRoots: [vscode.Uri.joinPath(this.context.extensionUri, 'out')]
3333
};
3434
webviewPanel.webview.html = this._getWebviewContent(webviewPanel.webview);
35+
webviewPanel.onDidChangeViewState(e => {
36+
this.currentPanel = e.webviewPanel;
37+
});
3538

3639
try {
3740
if (!this.registered) {

0 commit comments

Comments
 (0)