Allow specifying a custom limit for /search results (#12423)

<img width="497" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/94e94326-fb3c-4f9b-b4d9-7dd6f6f8d537">


e.g.

```
/search --9 foobar
```

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2024-05-29 14:11:05 +02:00 committed by GitHub
parent f3e6a0beab
commit a0644ac601
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 93 additions and 49 deletions

View file

@ -535,7 +535,7 @@ async fn try_fetch_server_binary<L: LspAdapter + 'static + Send + Sync + ?Sized>
binary
}
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct CodeLabel {
/// The text to display.
pub text: String,
@ -1540,6 +1540,15 @@ impl CodeLabel {
}
result
}
pub fn push_str(&mut self, text: &str, highlight: Option<HighlightId>) {
let start_ix = self.text.len();
self.text.push_str(text);
let end_ix = self.text.len();
if let Some(highlight) = highlight {
self.runs.push((start_ix..end_ix, highlight));
}
}
}
impl Ord for LanguageMatcher {