Improve outline fonts and colors (#63325)

Closes https://github.com/zed-industries/zed/issues/58580

* Outline modal and panel now use buffer fonts for the contents:

<img width="1728" height="1117" alt="modal"
src="https://github.com/user-attachments/assets/5e0ef6e3-be39-4949-bc32-7087a51a02ec"
/>
<img width="1728" height="1092" alt="panel"
src="https://github.com/user-attachments/assets/5cf9edbf-5ff3-402d-a2ca-bc915bd10e8e"
/>

* Gutter colors are now fall-backed to tree-sitter better, if no
semantic tokens could be retrieved due to multi buffer shenanigans:

<img width="1728" height="426" alt="gutter"
src="https://github.com/user-attachments/assets/a175b2c8-843e-4632-b030-3edfbd350982"
/>

Release Notes:

- Improved outline fonts and colors
This commit is contained in:
Kirill Bulatov authored and GitHub committed 2026-08-28 03:28:04 +00:00
1 parent 4c6c4750d3
commit 01acd0ee8e
8 files changed
+177 -60

No files matched your search

+9
View File
@@ -2,6 +2,7 @@
use std::{
collections::{BTreeMap, btree_map::Entry},
ops::Range,
sync::Arc,
};
@@ -61,6 +62,14 @@ impl SyntaxTheme {
self.highlights.get(highlight_index.into())
}
pub fn resolve_runs<'a, Id: Into<usize> + Copy + 'a>(
&'a self,
runs: impl IntoIterator<Item = &'a (Range<usize>, Id)> + 'a,
) -> impl Iterator<Item = (Range<usize>, HighlightStyle)> + 'a {
runs.into_iter()
.filter_map(|(range, highlight_id)| Some((range.clone(), *self.get(*highlight_id)?)))
}
pub fn style_for_name(&self, name: &str) -> Option<HighlightStyle> {
self.capture_name_map
.get(name)