zed/assets/keymaps/linux
Kim Wittenburg 7c4f6ddad1
keymap: Fix shift-enter in search bar for JetBrains keymap (#65129)
## 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>
2026-10-05 21:02:44 +00:00
..
atom.json Add trailing commas to all asset jsonc files following #43854 (#44891) 2025-12-15 15:09:52 +00:00
cursor.json Add LSP call hierarchy modal (#53239) 2026-08-27 16:21:41 +00:00
emacs.json Add action parameter comment_empty_lines for editor::ToggleComments (#63961) 2026-09-10 13:39:44 +00:00
jetbrains.json keymap: Fix shift-enter in search bar for JetBrains keymap (#65129) 2026-10-05 21:02:44 +00:00
sublime_text.json Add trailing commas to all asset jsonc files following #43854 (#44891) 2025-12-15 15:09:52 +00:00
vscode.json Add action parameter comment_empty_lines for editor::ToggleComments (#63961) 2026-09-10 13:39:44 +00:00