Skip to content

Commit

Permalink
Merge pull request #7 from Kanahiro/chores
Browse files Browse the repository at this point in the history
Chores
  • Loading branch information
Kanahiro authored Aug 7, 2024
2 parents 0e12eed + 93d4a8c commit 29bb7c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Other"
],
"activationEvents": [],
"main": "./out/extension.js",
"main": "./out/extension.cjs",
"contributes": {
"commands": [
{
Expand All @@ -20,6 +20,7 @@
}
]
},
"type": "module",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
Expand Down
8 changes: 6 additions & 2 deletions src/extension.ts → src/extension.cts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from 'vscode';
import { createWebview, updateStyle } from './viewer';
import { createWebview, updateStyle } from './viewer.cjs';

export function activate(context: vscode.ExtensionContext) {
const disposable = vscode.commands.registerCommand(
Expand All @@ -8,7 +8,11 @@ export function activate(context: vscode.ExtensionContext) {
const target = vscode.window.activeTextEditor?.document;
const panel = createWebview();

updateStyle(panel.webview, target?.getText() ?? '');
setTimeout(() => {
// take interval to wait webview rendered
updateStyle(panel.webview, target?.getText() ?? '');
}, 500);

panel.onDidChangeViewState(() => {
updateStyle(panel.webview, target?.getText() ?? '');
});
Expand Down
File renamed without changes.

0 comments on commit 29bb7c4

Please sign in to comment.