Snapshot file instead of path when creating a buffer snapshot

This commit is contained in:
Antonio Scandurra
2022-06-08 14:29:14 +02:00
parent 15b13fe511
commit eda569d6b2
5 changed files with 21 additions and 20 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ impl Debug for TransformBlock {
Self::Custom(block) => f.debug_struct("Custom").field("block", block).finish(),
Self::ExcerptHeader { buffer, .. } => f
.debug_struct("ExcerptHeader")
.field("path", &buffer.path())
.field("path", &buffer.file().map(|f| f.path()))
.finish(),
}
}
+2 -1
View File
@@ -838,7 +838,8 @@ impl EditorElement {
let mut filename = None;
let mut parent_path = None;
if let Some(path) = buffer.path() {
if let Some(file) = buffer.file() {
let path = file.path();
filename =
path.file_name().map(|f| f.to_string_lossy().to_string());
parent_path =