Use proper path separator for multi buffer headers (#23635)

Before: 


![bad](https://github.com/user-attachments/assets/ab20836a-b3bb-4b33-8ce4-eecc79d5f02f)


After:


![good](https://github.com/user-attachments/assets/40c328d1-2ef1-4a9b-9de9-9be9bba26756)


Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-01-25 10:35:22 +02:00 committed by GitHub
parent 5f417eda25
commit 392b95b179
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2612,9 +2612,9 @@ impl EditorElement {
let filename = path
.as_ref()
.and_then(|path| Some(path.file_name()?.to_string_lossy().to_string()));
let parent_path = path
.as_ref()
.and_then(|path| Some(path.parent()?.to_string_lossy().to_string() + "/"));
let parent_path = path.as_ref().and_then(|path| {
Some(path.parent()?.to_string_lossy().to_string() + std::path::MAIN_SEPARATOR_STR)
});
let focus_handle = self.editor.focus_handle(cx);
let colors = cx.theme().colors();