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
|
@ -44,6 +44,11 @@ impl SyntaxTheme {
|
|||
self.get(name).color.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn highlight_id(&self, name: &str) -> Option<u32> {
|
||||
let ix = self.highlights.iter().position(|entry| entry.0 == name)?;
|
||||
Some(ix as u32)
|
||||
}
|
||||
|
||||
/// Returns a new [`Arc<SyntaxTheme>`] with the given syntax styles merged in.
|
||||
pub fn merge(base: Arc<Self>, user_syntax_styles: Vec<(String, HighlightStyle)>) -> Arc<Self> {
|
||||
if user_syntax_styles.is_empty() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue