mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 22:13:58 -05:00
Fix CodeMirror retaining history of unrelated notes (#1640)
This commit is contained in:
parent
fff0bd6e55
commit
9f4f3d59d7
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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue