multi_buffer: Merge adjacent matches into a single excerpt when separated by only one line (#31708)
Closes #31252 Release Notes: - Improved displaying of project search matches or diagnostics when the excerpts are adjacent. --------- Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
59686f1f44
commit
07dab4e94a
2 changed files with 3 additions and 3 deletions
|
@ -1690,7 +1690,9 @@ impl MultiBuffer {
|
|||
last_range.context.start <= range.context.start,
|
||||
"Last range: {last_range:?} Range: {range:?}"
|
||||
);
|
||||
if last_range.context.end >= range.context.start {
|
||||
if last_range.context.end >= range.context.start
|
||||
|| last_range.context.end.row + 1 == range.context.start.row
|
||||
{
|
||||
last_range.context.end = range.context.end.max(last_range.context.end);
|
||||
*counts.last_mut().unwrap() += 1;
|
||||
continue;
|
||||
|
|
|
@ -1592,7 +1592,6 @@ fn test_set_excerpts_for_buffer_ordering(cx: &mut TestAppContext) {
|
|||
six
|
||||
seven
|
||||
eight
|
||||
-----
|
||||
nine
|
||||
ten
|
||||
eleven
|
||||
|
@ -1848,7 +1847,6 @@ fn test_set_excerpts_for_buffer_rename(cx: &mut TestAppContext) {
|
|||
zero
|
||||
one
|
||||
two
|
||||
-----
|
||||
three
|
||||
four
|
||||
five
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue