plan(textarea-editor): fix stale jar reference in autocomplete

The Task 9 plan template used the captured \`jar\` closure variable in
acceptCompletion, which becomes stale after setLanguage's
tear-down-and-remount. Same class of bug Task 4's review caught and
fixed. Update the plan to match the correct implementation.
This commit is contained in:
mwiegand 2026-05-16 20:42:16 +02:00
parent 3d3629f592
commit 4bace3ab5a
No known key found for this signature in database

View file

@ -1024,7 +1024,10 @@ function acceptCompletion(entry) {
sel.removeAllRanges(); sel.removeAllRanges();
sel.addRange(range); sel.addRange(range);
// Force CodeJar to re-highlight + emit onUpdate. // Force CodeJar to re-highlight + emit onUpdate.
jar.updateCode(jar.toString()); // Use instance.jar (not bare `jar` closure) for consistency with
// setLanguage's tear-down-and-remount — the jar reference can be
// swapped at runtime.
instance.jar.updateCode(instance.jar.toString());
hidePopup(); hidePopup();
} }