editor: Drop multiline targets in navigation buffers (#36291)
Release Notes: - N/A
This commit is contained in:
parent
7784fac288
commit
864d4bc1d1
1 changed files with 12 additions and 2 deletions
|
@ -15909,10 +15909,15 @@ impl Editor {
|
||||||
.text_for_range(location.range.clone())
|
.text_for_range(location.range.clone())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
})
|
})
|
||||||
|
.filter(|text| !text.contains('\n'))
|
||||||
.unique()
|
.unique()
|
||||||
.take(3)
|
.take(3)
|
||||||
.join(", ");
|
.join(", ");
|
||||||
format!("{tab_kind} for {target}")
|
if target.is_empty() {
|
||||||
|
tab_kind.to_owned()
|
||||||
|
} else {
|
||||||
|
format!("{tab_kind} for {target}")
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.context("buffer title")?;
|
.context("buffer title")?;
|
||||||
|
|
||||||
|
@ -16117,10 +16122,15 @@ impl Editor {
|
||||||
.text_for_range(location.range.clone())
|
.text_for_range(location.range.clone())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
})
|
})
|
||||||
|
.filter(|text| !text.contains('\n'))
|
||||||
.unique()
|
.unique()
|
||||||
.take(3)
|
.take(3)
|
||||||
.join(", ");
|
.join(", ");
|
||||||
let title = format!("References to {target}");
|
let title = if target.is_empty() {
|
||||||
|
"References".to_owned()
|
||||||
|
} else {
|
||||||
|
format!("References to {target}")
|
||||||
|
};
|
||||||
Self::open_locations_in_multibuffer(
|
Self::open_locations_in_multibuffer(
|
||||||
workspace,
|
workspace,
|
||||||
locations,
|
locations,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue