Skip to content

Commit

Permalink
[NNotepad] Fix #255 call refresh() when editor changes by typing, pas…
Browse files Browse the repository at this point in the history
…ting, or deleting (#257)

* Fix #255 call refresh() when editor changes by typing, pasting, or deleting

* Remove original input event in editor
  • Loading branch information
ibelem authored Jun 21, 2024
1 parent 343a3c4 commit 6aaa22b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nnotepad/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ document.addEventListener('DOMContentLoaded', async (e) => {
disableMonospaceOptimizations: true,
});

editor.onDidChangeModelContent(() => {
refresh();
});

async function refresh(e) {
const code = editor.getValue();
$('#output').innerText = '';
Expand Down Expand Up @@ -59,7 +63,6 @@ document.addEventListener('DOMContentLoaded', async (e) => {
}
}

$('#input').addEventListener('input', Util.debounce(refresh, 500));
$('#device').addEventListener('change', refresh);

refresh();
Expand Down

0 comments on commit 6aaa22b

Please sign in to comment.