mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-26 11:27:10 -06:00
The inspector's tracking refusal doesn't cite an unrelated issue
#1344 is about the inspector missing hidden text, not about its removals going untracked, so the reference only sent a reader to the wrong place. Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
committed by
skylar taylor-barrick
co-authored by
opencode
parent
f87ab00a61
commit
080d2caeb0
@@ -1439,8 +1439,8 @@ fn inspect_doc(s: &mut Session, v: &Value) -> CmdResult {
|
||||
v.get("remove").and_then(Value::as_array).map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect()).unwrap_or_default();
|
||||
// The removals aren't tracked: they delete straight from the document, so on a document that
|
||||
// tracks changes the text would go with no revision to show for it, and the revision trail
|
||||
// would be broken behind the user's back (#1344 follow-up). Refuse the whole removal instead
|
||||
// of quietly untracking it. Reading the document (no `remove`) is always allowed.
|
||||
// would be broken behind the user's back. Refuse the whole removal instead of quietly
|
||||
// untracking it. Reading the document (no `remove`) is always allowed.
|
||||
if !remove.is_empty() && s.doc.settings.track_changes {
|
||||
return Err(CmdError::Disabled("the document tracks changes: stop tracking before removing content".into()));
|
||||
}
|
||||
@@ -2096,7 +2096,7 @@ mod tests {
|
||||
/// The inspector's removals delete straight from the document, so they aren't tracked: on a
|
||||
/// document that tracks changes the text would go with no revision to show for it, and the
|
||||
/// revision trail would be broken behind the user's back. The removal is refused instead,
|
||||
/// and the document is left as it was (#1344 follow-up).
|
||||
/// and the document is left as it was.
|
||||
#[test]
|
||||
fn inspect_removals_are_refused_while_the_document_tracks_changes() {
|
||||
let mut s = Session::new(Document::from_text("Visible text.\nHidden text."));
|
||||
|
||||
Reference in New Issue
Block a user