mirror of https://github.com/helix-editor/helix
Merge f9a03d1b75
into cb1ecc9128
commit
6ed51c4d39
|
@ -632,6 +632,9 @@ impl EditorView {
|
|||
let mut x = viewport.x;
|
||||
let current_doc = view!(editor).doc;
|
||||
|
||||
use std::collections::HashMap;
|
||||
let mut names_map: HashMap<&str, usize> = HashMap::new();
|
||||
|
||||
for doc in editor.documents() {
|
||||
let fname = doc
|
||||
.path()
|
||||
|
@ -641,6 +644,24 @@ impl EditorView {
|
|||
.to_str()
|
||||
.unwrap_or_default();
|
||||
|
||||
*names_map.entry(fname).or_insert(0) += 1;
|
||||
}
|
||||
|
||||
for doc in editor.documents() {
|
||||
let mut fname = doc
|
||||
.path()
|
||||
.unwrap_or(&scratch)
|
||||
.file_name()
|
||||
.unwrap_or_default()
|
||||
.to_str()
|
||||
.unwrap_or_default();
|
||||
|
||||
let rel_path = doc.relative_path().unwrap_or_default();
|
||||
|
||||
if *names_map.get(fname).unwrap() > 1 {
|
||||
fname = rel_path.to_str().unwrap_or_default();
|
||||
}
|
||||
|
||||
let style = if current_doc == doc.id() {
|
||||
bufferline_active
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue