Skip to content

Commit a21747f

Browse files
committed
fixed bug where the very last event is ignored
1 parent f9406ad commit a21747f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/commands/showPanel.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ async function handleMessage(
7373
);
7474
activeEditor.onChange((editor) => {
7575
const workspaceLocation = editor.workspaceLocation;
76-
const code = editor.getText();
77-
if (!code) {
78-
return;
79-
}
76+
const code = editor.getActualCode();
77+
8078
if (editor !== activeEditor) {
8179
console.log(
8280
`EXTENSION: Editor ${editor.assessmentName}_${editor.questionId} is no longer active, skipping onChange`,

src/utils/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ export class Editor {
150150
return;
151151
}
152152
self.log(`EXTENSION: Editor's code changed!`);
153-
self.onChangeCallback(self);
154153
self.code = text;
154+
self.onChangeCallback(self);
155155
},
156156
);
157157
return self;

0 commit comments

Comments
 (0)