Select the closest outline item when the outline view's query is empty

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-13 18:43:49 +01:00
parent 2660d37ad8
commit 055d48cfb2
3 changed files with 43 additions and 7 deletions

View file

@ -1917,7 +1917,11 @@ impl BufferSnapshot {
})
.collect::<Vec<_>>();
Some(Outline::new(items))
if items.is_empty() {
None
} else {
Some(Outline::new(items))
}
}
pub fn enclosing_bracket_ranges<T: ToOffset>(