return;
};
+ // The path should exist, because query_local_path is called when creating this object
if let Some(path) = &self.local_path {
println!("open file: {}", path.to_string_lossy());
open_file(path.to_string_lossy().as_ref());
- } else if let NoteId::Id(note_id) = self.id {
- self.is_opening = true;
- let proxy = doc.doc_proxy();
- self.backend.open_extern(note_id, |result|{
- proxy.call_mainthread(move |_doc, note|{
- note.is_opening = false;
- match result {
- OpenExternResult::Ok((path, istmp)) => {
- println!("open file: {}", path.to_string_lossy());
- open_file(path.to_string_lossy().as_ref());
- note.local_path = Some(path);
- note.is_tmp_file = istmp;
- }
- _ => {
- println!("open_extern failed");
- }
- }
- });
- });
}
}