Insert a time heading when creating a journal entry

This commit is contained in:
Nathan Sobo 2021-12-18 10:38:54 -07:00
parent 9e8ef31452
commit e4f18947de
6 changed files with 70 additions and 39 deletions

View file

@ -107,15 +107,15 @@ impl Pane {
&mut self,
project_path: ProjectPath,
cx: &mut ViewContext<Self>,
) -> bool {
) -> Option<Box<dyn ItemViewHandle>> {
if let Some(index) = self.items.iter().position(|item| {
item.project_path(cx.as_ref())
.map_or(false, |item_path| item_path == project_path)
}) {
self.activate_item(index, cx);
true
self.items.get(index).map(|handle| handle.boxed_clone())
} else {
false
None
}
}