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:
parent
3d3629f592
commit
4bace3ab5a
1 changed files with 4 additions and 1 deletions
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue