R6.3 round 2 fix: an explicit open of a shown file joins the list
Opening a file a tab already shows only focuses it; the recent list now learns it too. The restart regression reopens the restored file. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1abaa5dc83
commit
030ecfcff6
3 files changed
+24
-6
No files matched your search
@@ -472,9 +472,19 @@ mod window {
|
||||
assert!(desk.read_with(cx, |desk, _| desk.recent.is_empty()));
|
||||
let list = data.path().join("recent.json");
|
||||
assert_eq!(std::fs::read_to_string(&list).expect("the list"), "[]");
|
||||
// An explicit open still joins the list.
|
||||
// Explicit opens still join it, the restored file too.
|
||||
open(&desk, &a, cx);
|
||||
open(&desk, &b, cx);
|
||||
let real = dunce::canonicalize(&b).expect("real");
|
||||
assert_eq!(desk.read_with(cx, |desk, _| desk.recent.clone()), [real]);
|
||||
assert_eq!(names(&desk, cx), ["a.md", "b.md"]);
|
||||
let real = |path: &std::path::Path| dunce::canonicalize(path).expect("real");
|
||||
let (a, b) = (real(&a), real(&b));
|
||||
assert_eq!(
|
||||
desk.read_with(cx, |desk, _| desk.recent.clone()),
|
||||
[b.clone(), a.clone()]
|
||||
);
|
||||
let kept: Vec<std::path::PathBuf> =
|
||||
serde_json::from_str(&std::fs::read_to_string(&list).expect("the list"))
|
||||
.expect("a list");
|
||||
assert_eq!(kept, [b, a]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user