keymap: Update Prev to Previous for consistency (#25909)

Closes #10167

This is take 2 on https://github.com/zed-industries/zed/pull/2341 which
was closed due to lack of migrator.

This PR contains rename of following keymap actions: 
```sh
1. ["editor::GoToPrevHunk", { "center_cursor": true }] -> ["editor::GoToPreviousHunk", { "center_cursor": true }]
2. "editor::GoToPrevDiagnostic" -> "editor::GoToPreviousDiagnostic"
3. "editor::ContextMenuPrev" -> "editor::ContextMenuPrevious"
4. "search::SelectPrevMatch" -> "search::SelectPreviousMatch"
5. "file_finder::SelectPrev" -> "file_finder::SelectPrevious"
6. "menu::SelectPrev" -> "menu::SelectPrevious"
7. "editor::TabPrev" -> "editor::Backtab"
```

Release Notes:

- Renamed several keymap actions for consistency (e.g., `GoToPrevHunk` →
`GoToPreviousHunk`, `TabPrev` → `Backtab`). Your existing configured
keybindings will still work. You can click **"Backup and Update"** at
the top of your keymap file to easily update to the new actions.


Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
This commit is contained in:
smit 2025-03-03 17:44:49 +05:30 committed by GitHub
parent 61d584db45
commit 593f3dc1d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 320 additions and 198 deletions

View file

@ -1,7 +1,7 @@
use crate::{
buffer_search::Deploy, BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery,
ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPrevMatch, ToggleCaseSensitive,
ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPreviousMatch,
ToggleCaseSensitive, ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
};
use anyhow::Context as _;
use collections::{HashMap, HashSet};
@ -90,7 +90,7 @@ pub fn init(cx: &mut App) {
);
register_workspace_action(
workspace,
move |search_bar, action: &SelectPrevMatch, window, cx| {
move |search_bar, action: &SelectPreviousMatch, window, cx| {
search_bar.select_prev_match(action, window, cx)
},
);
@ -1440,9 +1440,9 @@ impl ProjectSearchBar {
self.cycle_field(Direction::Next, window, cx);
}
fn tab_previous(
fn backtab(
&mut self,
_: &editor::actions::TabPrev,
_: &editor::actions::Backtab,
window: &mut Window,
cx: &mut Context<Self>,
) {
@ -1697,7 +1697,7 @@ impl ProjectSearchBar {
fn select_prev_match(
&mut self,
_: &SelectPrevMatch,
_: &SelectPreviousMatch,
window: &mut Window,
cx: &mut Context<Self>,
) {
@ -1896,7 +1896,7 @@ impl Render for ProjectSearchBar {
move |window, cx| {
Tooltip::for_action_in(
"Go To Previous Match",
&SelectPrevMatch,
&SelectPreviousMatch,
&focus_handle,
window,
cx,
@ -2095,7 +2095,7 @@ impl Render for ProjectSearchBar {
cx.stop_propagation();
}))
.capture_action(cx.listener(|this, action, window, cx| {
this.tab_previous(action, window, cx);
this.backtab(action, window, cx);
cx.stop_propagation();
}))
.on_action(cx.listener(|this, action, window, cx| this.confirm(action, window, cx)))