editor: Add active match highlight for buffer and project search (#44098)

Closes #28617

<img width="400" alt="image"
src="https://github.com/user-attachments/assets/b1c2880c-5744-4bed-a687-5c5e7aa7fef5"
/>

Release Notes:

- Improved visibility of the currently active match when browsing
results in buffer or project search.

---------

Co-authored-by: DarkMatter-999 <darkmatter999official@gmail.com>
This commit is contained in:
Smit Barmase
2025-12-04 03:55:04 +05:30
committed by GitHub
co-authored by DarkMatter-999
parent 87976e91cf
commit 8ad3a150c8
23 changed files with 342 additions and 149 deletions
@@ -252,10 +252,11 @@ impl Console {
let start_offset = range.start;
let range = buffer.anchor_after(MultiBufferOffset(range.start))
..buffer.anchor_before(MultiBufferOffset(range.end));
let color_fn = color_fetcher(color);
console.highlight_background_key::<ConsoleAnsiHighlight>(
start_offset,
&[range],
color_fetcher(color),
move |_, theme| color_fn(theme),
cx,
);
}