Thorsten Ball
Thorsten Ball
Agree with that. `.trim()` on input and then use ```rust let re = Regex::new(r"\s+").unwrap(); let result = re.replace_all(query, " "); ``` but put the regex into `lazy_static!` like this: https://github.com/zed-industries/zed/blob/d48fe0a1320d86bab15a0167418a0d3ae933ccc9/crates/languages/src/go.rs#L31-L33
Looks like you need to run the formatter: ```diff - let query = CONSECUTIVE_WHITESPACES.replace_all(&query.trim(), " ").to_string(); + let query = CONSECUTIVE_WHITESPACES + .replace_all(&query.trim(), " ") + .to_string(); ```
Thanks @TerminalFi! That makes sense. Felt a bit unsure about the regex myself. The only "problem" with your manual method I see is that `.is_whitespace` returns true for more than...
Are you saying that this is a Zed issue or is it a rust-analyzer issue? If it's the latter, I think an issue opened in the rust-analyzer repository might make...
How does this work when I have multiple cursors or a visual block selection and I want each cursor only to search on its own line?
> but I haven't found a way to create multiple cursors in vim normal mode other than visual block selection. FWIW you can use `opt-click` (it would be neat if...
@PgBiel do you have Xcode and could record a profile of when that happens? It's really hard to get to the bottom of this without circling in on when exactly...
> For reference, though, I was editing the Typst codebase (at https://github.com/typst/typst). Great! That's fantastic to know. Anything specific you did there? Any file you had open that triggered this?
Cloned, built, and opened `typst/typst` in Zed (current version from `main`) and opened a few of the longest files: `typst-syntax/src/ast.rs`, `typst/src/visualize/color.rs`. With and without inlay hints I can't detect any...
@mocenigo thank you! That'd be fantastic if you can reproduce it. _If_ you can reliably reproduce it with a specific file and you can share it, you can also email...