Don't report a buffer when it doesn't contain any matches

This commit is contained in:
Antonio Scandurra 2022-02-25 15:40:19 +01:00
parent 2611b5449f
commit 29e035a70d

View file

@ -2205,8 +2205,11 @@ impl Project {
snapshot.anchor_before(range.start)
..snapshot.anchor_after(range.end)
})
.collect();
worker_matched_buffers.insert(buffer.clone(), buffer_matches);
.collect::<Vec<_>>();
if !buffer_matches.is_empty() {
worker_matched_buffers
.insert(buffer.clone(), buffer_matches);
}
}
});
}