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:
parent
f3e6a0beab
commit
a0644ac601
5 changed files with 93 additions and 49 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue