parent
001ec97c0e
commit
d8fc779a67
3 changed files with 27 additions and 21 deletions
|
@ -10,6 +10,7 @@ use itertools::Itertools;
|
|||
use paths::contexts_dir;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{collections::VecDeque, path::Path, sync::Arc, time::Duration};
|
||||
use ui::ElementId;
|
||||
use util::ResultExt as _;
|
||||
|
||||
const MAX_RECENTLY_OPENED_ENTRIES: usize = 6;
|
||||
|
@ -68,6 +69,15 @@ pub enum HistoryEntryId {
|
|||
TextThread(Arc<Path>),
|
||||
}
|
||||
|
||||
impl Into<ElementId> for HistoryEntryId {
|
||||
fn into(self) -> ElementId {
|
||||
match self {
|
||||
HistoryEntryId::AcpThread(session_id) => ElementId::Name(session_id.0.into()),
|
||||
HistoryEntryId::TextThread(path) => ElementId::Path(path),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
enum SerializedRecentOpen {
|
||||
AcpThread(String),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue