mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-02 21:40:41 +01:00
fd0b7732b8
## Summary Closes #65834 In project search, the query text starts a few pixels to the right of the Include/Exclude text, which makes it look like the query begins with a space. The query and replace inputs are `AutoHeight` editors. `Editor::new` enables `offset_content` for every mode except `SingleLine`, and that adds a gutter margin (the font's descent) before the text. The Include/Exclude inputs are `SingleLine` editors and get no margin. Both sit inside the same `input_base_styles` padding, so the texts end up misaligned. I disabled `offset_content` on the query and replacement editors in both project search and buffer search, so all search inputs now start their text at the same inset. The doc comment on `set_offset_content` mentions this case directly (aligning editor text with text above or below it). Before (from the issue): https://github.com/user-attachments/assets/a3c6befe-313e-4f55-9cd8-5b826d0898bd After: <img width="986" height="164" alt="image" src="https://github.com/user-attachments/assets/d529b272-2c74-4543-879d-d706a5c705bf" /> ## Testing - macOS, debug build: opened project search (`cmd-shift-f`), turned on the filters, and checked that "Search all files…" and "Include: e.g. src/**/*.rs" start at the same x position. - `cargo test -p search` passes (101 tests). ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed project search query text being misaligned with the Include/Exclude filter inputs. - Fixed search and replace inputs having extra left padding compared to other inputs.