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

@ -21,7 +21,7 @@ use git::{RestoreTrackedFiles, StageAll, TrashUntrackedFiles, UnstageAll};
use gpui::*;
use itertools::Itertools;
use language::{Buffer, File};
use menu::{Confirm, SecondaryConfirm, SelectFirst, SelectLast, SelectNext, SelectPrev};
use menu::{Confirm, SecondaryConfirm, SelectFirst, SelectLast, SelectNext, SelectPrevious};
use multi_buffer::ExcerptInfo;
use panel::{
panel_editor_container, panel_editor_style, panel_filled_button, panel_icon_button, PanelHeader,
@ -581,7 +581,12 @@ impl GitPanel {
}
}
fn select_prev(&mut self, _: &SelectPrev, _window: &mut Window, cx: &mut Context<Self>) {
fn select_previous(
&mut self,
_: &SelectPrevious,
_window: &mut Window,
cx: &mut Context<Self>,
) {
let item_count = self.entries.len();
if item_count == 0 {
return;
@ -2596,7 +2601,7 @@ impl Render for GitPanel {
})
.on_action(cx.listener(Self::select_first))
.on_action(cx.listener(Self::select_next))
.on_action(cx.listener(Self::select_prev))
.on_action(cx.listener(Self::select_previous))
.on_action(cx.listener(Self::select_last))
.on_action(cx.listener(Self::close_panel))
.on_action(cx.listener(Self::open_diff))

View file

@ -3,7 +3,7 @@ use anyhow::Result;
use buffer_diff::{BufferDiff, DiffHunkSecondaryStatus};
use collections::HashSet;
use editor::{
actions::{GoToHunk, GoToPrevHunk},
actions::{GoToHunk, GoToPreviousHunk},
scroll::Autoscroll,
Editor, EditorEvent, ToPoint,
};
@ -869,7 +869,7 @@ impl Render for ProjectDiffToolbar {
.shape(ui::IconButtonShape::Square)
.tooltip(Tooltip::for_action_title_in(
"Go to previous hunk",
&GoToPrevHunk {
&GoToPreviousHunk {
center_cursor: false,
},
&focus_handle,
@ -877,7 +877,7 @@ impl Render for ProjectDiffToolbar {
.disabled(!button_states.prev_next)
.on_click(cx.listener(|this, _, window, cx| {
this.dispatch_action(
&GoToPrevHunk {
&GoToPreviousHunk {
center_cursor: true,
},
window,