mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
helix-term/commands: display buffer id in picker
This commit is contained in:
parent
d11b652139
commit
a1207fd768
@ -3385,7 +3385,7 @@ fn format(&self) -> Cow<str> {
|
||||
.map(helix_core::path::get_relative_path);
|
||||
let path = match path.as_deref().and_then(Path::to_str) {
|
||||
Some(path) => path,
|
||||
None => return Cow::Borrowed(SCRATCH_BUFFER_NAME),
|
||||
None => SCRATCH_BUFFER_NAME,
|
||||
};
|
||||
|
||||
let mut flags = Vec::new();
|
||||
@ -3401,7 +3401,7 @@ fn format(&self) -> Cow<str> {
|
||||
} else {
|
||||
format!(" ({})", flags.join(""))
|
||||
};
|
||||
Cow::Owned(format!("{}{}", path, flag))
|
||||
Cow::Owned(format!("{} {}{}", self.id, path, flag))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,12 @@ fn default() -> DocumentId {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for DocumentId {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_fmt(format_args!("{}", self.0))
|
||||
}
|
||||
}
|
||||
|
||||
slotmap::new_key_type! {
|
||||
pub struct ViewId;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user