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

@ -44,7 +44,7 @@ use workspace::{
Workspace,
};
actions!(file_finder, [SelectPrev, ToggleMenu]);
actions!(file_finder, [SelectPrevious, ToggleMenu]);
impl ModalView for FileFinder {
fn on_before_dismiss(
@ -199,9 +199,14 @@ impl FileFinder {
}
}
fn handle_select_prev(&mut self, _: &SelectPrev, window: &mut Window, cx: &mut Context<Self>) {
fn handle_select_prev(
&mut self,
_: &SelectPrevious,
window: &mut Window,
cx: &mut Context<Self>,
) {
self.init_modifiers = Some(window.modifiers());
window.dispatch_action(Box::new(menu::SelectPrev), cx);
window.dispatch_action(Box::new(menu::SelectPrevious), cx);
}
fn handle_toggle_menu(&mut self, _: &ToggleMenu, window: &mut Window, cx: &mut Context<Self>) {

View file

@ -3,7 +3,7 @@ use std::{assert_eq, future::IntoFuture, path::Path, time::Duration};
use super::*;
use editor::Editor;
use gpui::{Entity, TestAppContext, VisualTestContext};
use menu::{Confirm, SelectNext, SelectPrev};
use menu::{Confirm, SelectNext, SelectPrevious};
use project::{RemoveOptions, FS_WATCH_LATENCY};
use serde_json::json;
use util::path;
@ -2059,7 +2059,7 @@ async fn test_switches_between_release_norelease_modes_on_backward_nav(
// Switch to navigating with other shortcuts
// Don't open file on modifiers release
cx.simulate_modifiers_change(Modifiers::control());
cx.dispatch_action(menu::SelectPrev);
cx.dispatch_action(menu::SelectPrevious);
cx.simulate_modifiers_change(Modifiers::none());
picker.update(cx, |finder, _| {
assert_eq!(finder.delegate.matches.len(), 3);
@ -2071,7 +2071,7 @@ async fn test_switches_between_release_norelease_modes_on_backward_nav(
// Back to navigation with initial shortcut
// Open file on modifiers release
cx.simulate_modifiers_change(Modifiers::secondary_key());
cx.dispatch_action(SelectPrev); // <-- File Finder's SelectPrev, not menu's
cx.dispatch_action(SelectPrevious); // <-- File Finder's SelectPrevious, not menu's
cx.simulate_modifiers_change(Modifiers::none());
cx.read(|cx| {
let active_editor = workspace.read(cx).active_item_as::<Editor>(cx).unwrap();