mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-21 22:31:05 +00:00
## Summary This PR fixes https://github.com/zed-industries/zed/issues/62696. The current JetBrains keymap binds `shift-enter` to `editor::NewlineBelow`. While that is correct for most contexts, in the search bar it is not. In the search bar JetBrains products use `shift-enter` to search backwards. The current keymap already tries to rectify this by adding an explicit `search::SelectPreviousMatch` mapping. However the precedence of this mapping is shadowed by an `Editor && mode == auto_height` match. This PR fixes the issue by giving the `search::SelectPreviousMatch` a higher precedence by making it more specific to the search bar. ## Testing (instructions for macOS) 1. Run a build with the modified keymap 2. Open a file and search via Cmd+F 3. Enter some text that occurs multiple times in the file 4. Press Shift-Enter. Notice that this searches in the document and rotates through the matches in reverse order. A note for test code: At first I didn't add a test for this change but then I saw that a test for a similar change exists (`test_thread_search_shift_enter_navigates_with_jetbrains_keymap`). The test is AI generated. As far as I can tell the test makes sense, but I'm not really familiar with the UI code. If you prefer to have the test removed/changed, please tell me. ## 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 default Shift-Enter behavior in the JetBrains keymap to select the previous search match --------- Co-authored-by: MrSubidubi <finn@zed.dev> |
||
|---|---|---|
| .. | ||
| atom.json | ||
| cursor.json | ||
| emacs.json | ||
| jetbrains.json | ||
| sublime_text.json | ||
| vscode.json | ||