fix: protect editor saves and clear failed restored tab state
This commit is contained in:
@@ -8,7 +8,7 @@ from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import Callable, Protocol
|
||||
|
||||
from .file_versions import VersionStore
|
||||
from .file_versions import VersionStore, _UNCHECKED
|
||||
|
||||
FileSignature = tuple[int, int] | None
|
||||
DRAFTS_KEY = "editor/drafts"
|
||||
@@ -46,8 +46,8 @@ class DocumentStore:
|
||||
return relocate_images(source, original, target)
|
||||
|
||||
@staticmethod
|
||||
def save(path: Path, source: str) -> None:
|
||||
VersionStore().save(path, source)
|
||||
def save(path: Path, source: str, *, expected=_UNCHECKED) -> None:
|
||||
VersionStore().save(path, source, expected=expected)
|
||||
|
||||
|
||||
class DraftStore:
|
||||
|
||||
Reference in New Issue
Block a user