@SomeoneToIgnore This code should 100% work for future Zed users, but for current Zed users, Zed's internal list of recents may not be synced w/ macOS' Recent Documents at first. If needed this can be fixed by calling `cx.refresh_recent_documents` on startup, but that feels a bit unnecessary. Release Notes: - Fixes behavior of Recent Documents list on macOS
This commit is contained in:
parent
35e1229fbb
commit
30193647f3
9 changed files with 17 additions and 89 deletions
|
@ -764,12 +764,8 @@ impl Platform for MacPlatform {
|
|||
}
|
||||
}
|
||||
|
||||
fn add_recent_documents(&self, paths: &[PathBuf]) {
|
||||
for path in paths {
|
||||
let Some(path_str) = path.to_str() else {
|
||||
log::error!("Not adding to recent documents a non-unicode path: {path:?}");
|
||||
continue;
|
||||
};
|
||||
fn add_recent_document(&self, path: &Path) {
|
||||
if let Some(path_str) = path.to_str() {
|
||||
unsafe {
|
||||
let document_controller: id =
|
||||
msg_send![class!(NSDocumentController), sharedDocumentController];
|
||||
|
@ -779,14 +775,6 @@ impl Platform for MacPlatform {
|
|||
}
|
||||
}
|
||||
|
||||
fn clear_recent_documents(&self) {
|
||||
unsafe {
|
||||
let document_controller: id =
|
||||
msg_send![class!(NSDocumentController), sharedDocumentController];
|
||||
let _: () = msg_send![document_controller, clearRecentDocuments:nil];
|
||||
}
|
||||
}
|
||||
|
||||
fn local_timezone(&self) -> UtcOffset {
|
||||
unsafe {
|
||||
let local_timezone: id = msg_send![class!(NSTimeZone), localTimeZone];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue