mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix CodeMirror retaining history of unrelated notes (#1640)
This commit is contained in:
parent
30bbbaf00b
commit
c5280cd056
1 changed files with 5 additions and 0 deletions
|
@ -147,6 +147,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
let noteId: number | null = null;
|
let noteId: number | null = null;
|
||||||
export function setNoteId(ntid: number): void {
|
export function setNoteId(ntid: number): void {
|
||||||
|
// TODO this is a hack, because it requires the NoteEditor to know implementation details of the PlainTextInput.
|
||||||
|
// It should be refactored once we work on our own Undo stack
|
||||||
|
for (const pi of plainTextInputs) {
|
||||||
|
pi.api.getEditor().clearHistory();
|
||||||
|
}
|
||||||
noteId = ntid;
|
noteId = ntid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue