From 21dd8c21b899d56cb9d9f34ca78ae00235deb47c Mon Sep 17 00:00:00 2001 From: smit <0xtimsb@gmail.com> Date: Mon, 3 Mar 2025 17:44:49 +0530 Subject: [PATCH] keymap: Update `Prev` to `Previous` for consistency (#25909) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- assets/keymaps/default-linux.json | 259 ++++-- assets/keymaps/default-macos.json | 534 ++++++++++--- assets/keymaps/linux/atom.json | 2 +- assets/keymaps/linux/emacs.json | 2 +- assets/keymaps/linux/jetbrains.json | 62 +- assets/keymaps/linux/sublime_text.json | 155 +++- assets/keymaps/macos/atom.json | 2 +- assets/keymaps/macos/emacs.json | 2 +- assets/keymaps/macos/jetbrains.json | 69 +- assets/keymaps/macos/sublime_text.json | 155 +++- assets/keymaps/macos/textmate.json | 2 +- assets/keymaps/storybook.json | 6 +- assets/keymaps/vim.json | 753 +++++++++++++++--- crates/assistant2/src/thread_history.rs | 6 +- crates/collab_ui/src/collab_panel.rs | 6 +- crates/editor/src/actions.rs | 8 +- crates/editor/src/editor.rs | 13 +- crates/editor/src/editor_tests.rs | 50 +- crates/editor/src/element.rs | 6 +- crates/file_finder/src/file_finder.rs | 11 +- crates/file_finder/src/file_finder_tests.rs | 6 +- crates/git_ui/src/git_panel.rs | 11 +- crates/git_ui/src/project_diff.rs | 6 +- crates/menu/src/menu.rs | 2 +- crates/migrator/src/migrator.rs | 106 ++- crates/outline/src/outline.rs | 2 +- crates/outline_panel/src/outline_panel.rs | 18 +- crates/picker/src/picker.rs | 9 +- crates/project_panel/src/project_panel.rs | 14 +- crates/repl/src/notebook/notebook_ui.rs | 2 +- crates/search/src/buffer_search.rs | 44 +- crates/search/src/project_search.rs | 16 +- crates/search/src/search.rs | 2 +- crates/settings/src/keymap_file.rs | 2 +- crates/storybook/src/stories/picker.rs | 4 +- crates/tab_switcher/src/tab_switcher_tests.rs | 4 +- crates/ui/src/components/context_menu.rs | 11 +- crates/ui/src/components/navigable.rs | 4 +- crates/vim/src/command.rs | 10 +- crates/zed/src/zed/app_menus.rs | 2 +- crates/zed/src/zed/linux_prompts.rs | 9 +- crates/zed/src/zed/quick_action_bar.rs | 8 +- crates/zeta/src/rate_completion_modal.rs | 9 +- 43 files changed, 1910 insertions(+), 494 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index fc58fb1cd95b17c94bf77f99a1747d0fbae423c6..1bd8e41ad16f5f6ad7ffc90f3d7176c3c60c5d0b 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -10,24 +10,49 @@ "pagedown": "menu::SelectLast", "ctrl-n": "menu::SelectNext", "tab": "menu::SelectNext", - "ctrl-p": "menu::SelectPrev", - "shift-tab": "menu::SelectPrev", + "ctrl-p": "menu::SelectPrevious", + "shift-tab": "menu::SelectPrevious", "enter": "menu::Confirm", "ctrl-enter": "menu::SecondaryConfirm", "ctrl-escape": "menu::Cancel", "ctrl-c": "menu::Cancel", "escape": "menu::Cancel", "alt-shift-enter": "menu::Restart", - "alt-enter": ["picker::ConfirmInput", { "secondary": false }], - "ctrl-alt-enter": ["picker::ConfirmInput", { "secondary": true }], + "alt-enter": [ + "picker::ConfirmInput", + { + "secondary": false + } + ], + "ctrl-alt-enter": [ + "picker::ConfirmInput", + { + "secondary": true + } + ], "ctrl-shift-w": "workspace::CloseWindow", "shift-escape": "workspace::ToggleZoom", "open": "workspace::Open", "ctrl-o": "workspace::Open", "ctrl-=": ["zed::IncreaseBufferFontSize", { "persist": false }], - "ctrl-+": ["zed::IncreaseBufferFontSize", { "persist": false }], - "ctrl--": ["zed::DecreaseBufferFontSize", { "persist": false }], - "ctrl-0": ["zed::ResetBufferFontSize", { "persist": false }], + "ctrl-+": [ + "zed::IncreaseBufferFontSize", + { + "persist": false + } + ], + "ctrl--": [ + "zed::DecreaseBufferFontSize", + { + "persist": false + } + ], + "ctrl-0": [ + "zed::ResetBufferFontSize", + { + "persist": false + } + ], "ctrl-,": "zed::OpenSettings", "ctrl-q": "zed::Quit", "f11": "zed::ToggleFullScreen", @@ -38,14 +63,14 @@ { "context": "Picker || menu", "bindings": { - "up": "menu::SelectPrev", + "up": "menu::SelectPrevious", "down": "menu::SelectNext" } }, { "context": "Prompt", "bindings": { - "left": "menu::SelectPrev", + "left": "menu::SelectPrevious", "right": "menu::SelectNext" } }, @@ -57,7 +82,7 @@ "backspace": "editor::Backspace", "delete": "editor::Delete", "tab": "editor::Tab", - "shift-tab": "editor::TabPrev", + "shift-tab": "editor::Backtab", "ctrl-k": "editor::CutToEndOfLine", // "ctrl-t": "editor::Transpose", "ctrl-k ctrl-q": "editor::Rewrap", @@ -84,12 +109,23 @@ "pageup": "editor::MovePageUp", "alt-pageup": "editor::PageUp", "shift-pageup": "editor::SelectPageUp", - "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], + "home": [ + "editor::MoveToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], "down": "editor::MoveDown", "pagedown": "editor::MovePageDown", "alt-pagedown": "editor::PageDown", "shift-pagedown": "editor::SelectPageDown", - "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }], + "end": [ + "editor::MoveToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], "left": "editor::MoveLeft", "right": "editor::MoveRight", "ctrl-left": "editor::MoveToPreviousWordStart", @@ -109,10 +145,21 @@ "ctrl-shift-i": "editor::Format", // "cmd-shift-left": ["editor::SelectToBeginningOfLine", {"stop_at_soft_wraps": true, "stop_at_indent": true }], // "ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], + "shift-home": [ + "editor::SelectToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], // "cmd-shift-right": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], // "ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], - "shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], + "shift-end": [ + "editor::SelectToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], // "alt-v": ["editor::MovePageUp", { "center_cursor": true }], "ctrl-alt-space": "editor::ShowCharacterPalette", "ctrl-;": "editor::ToggleLineNumbers", @@ -180,7 +227,7 @@ "ctrl-k c": "assistant::CopyCode", "ctrl-shift-e": "project_panel::ToggleFocus", "ctrl-g": "search::SelectNextMatch", - "ctrl-shift-g": "search::SelectPrevMatch", + "ctrl-shift-g": "search::SelectPreviousMatch", "ctrl-alt-/": "assistant::ToggleModelSelector", "ctrl-k h": "assistant::DeployHistory", "ctrl-k l": "assistant::DeployPromptLibrary", @@ -203,7 +250,7 @@ "escape": "buffer_search::Dismiss", "tab": "buffer_search::FocusEditor", "enter": "search::SelectNextMatch", - "shift-enter": "search::SelectPrevMatch", + "shift-enter": "search::SelectPreviousMatch", "alt-enter": "search::SelectAllMatches", "find": "search::FocusSearch", "ctrl-f": "search::FocusSearch", @@ -276,22 +323,57 @@ "ctrl-pagedown": "pane::ActivateNextItem", "ctrl-shift-pageup": "pane::SwapItemLeft", "ctrl-shift-pagedown": "pane::SwapItemRight", - "ctrl-f4": ["pane::CloseActiveItem", { "close_pinned": false }], - "ctrl-w": ["pane::CloseActiveItem", { "close_pinned": false }], - "alt-ctrl-t": ["pane::CloseInactiveItems", { "close_pinned": false }], + "ctrl-f4": [ + "pane::CloseActiveItem", + { + "close_pinned": false + } + ], + "ctrl-w": [ + "pane::CloseActiveItem", + { + "close_pinned": false + } + ], + "alt-ctrl-t": [ + "pane::CloseInactiveItems", + { + "close_pinned": false + } + ], "alt-ctrl-shift-w": "workspace::CloseInactiveTabsAndPanes", - "ctrl-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }], - "ctrl-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }], - "ctrl-k u": ["pane::CloseCleanItems", { "close_pinned": false }], - "ctrl-k w": ["pane::CloseAllItems", { "close_pinned": false }], + "ctrl-k e": [ + "pane::CloseItemsToTheLeft", + { + "close_pinned": false + } + ], + "ctrl-k t": [ + "pane::CloseItemsToTheRight", + { + "close_pinned": false + } + ], + "ctrl-k u": [ + "pane::CloseCleanItems", + { + "close_pinned": false + } + ], + "ctrl-k w": [ + "pane::CloseAllItems", + { + "close_pinned": false + } + ], "back": "pane::GoBack", "ctrl-alt--": "pane::GoBack", "ctrl-alt-_": "pane::GoForward", "forward": "pane::GoForward", "ctrl-alt-g": "search::SelectNextMatch", "f3": "search::SelectNextMatch", - "ctrl-alt-shift-g": "search::SelectPrevMatch", - "shift-f3": "search::SelectPrevMatch", + "ctrl-alt-shift-g": "search::SelectPreviousMatch", + "shift-f3": "search::SelectPreviousMatch", "shift-find": "project_search::ToggleFocus", "ctrl-shift-f": "project_search::ToggleFocus", "ctrl-alt-shift-h": "search::ToggleReplace", @@ -324,17 +406,47 @@ "alt-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection "ctrl-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection "ctrl-f2": "editor::SelectAllMatches", // Select all occurrences of current word - "ctrl-d": ["editor::SelectNext", { "replace_newest": false }], - "ctrl-shift-down": ["editor::SelectNext", { "replace_newest": false }], // Add selection to Next Find Match - "ctrl-shift-up": ["editor::SelectPrevious", { "replace_newest": false }], - "ctrl-k ctrl-d": ["editor::SelectNext", { "replace_newest": true }], - "ctrl-k ctrl-shift-d": ["editor::SelectPrevious", { "replace_newest": true }], + "ctrl-d": [ + "editor::SelectNext", + { + "replace_newest": false + } + ], + "ctrl-shift-down": [ + "editor::SelectNext", + { + "replace_newest": false + } + ], // Add selection to Next Find Match + "ctrl-shift-up": [ + "editor::SelectPrevious", + { + "replace_newest": false + } + ], + "ctrl-k ctrl-d": [ + "editor::SelectNext", + { + "replace_newest": true + } + ], + "ctrl-k ctrl-shift-d": [ + "editor::SelectPrevious", + { + "replace_newest": true + } + ], "ctrl-k ctrl-i": "editor::Hover", - "ctrl-/": ["editor::ToggleComments", { "advance_downwards": false }], + "ctrl-/": [ + "editor::ToggleComments", + { + "advance_downwards": false + } + ], "ctrl-u": "editor::UndoSelection", "ctrl-shift-u": "editor::RedoSelection", "f8": "editor::GoToDiagnostic", - "shift-f8": "editor::GoToPrevDiagnostic", + "shift-f8": "editor::GoToPreviousDiagnostic", "f2": "editor::Rename", "f12": "editor::GoToDefinition", "alt-f12": "editor::GoToDefinitionSplit", @@ -373,7 +485,7 @@ "alt-y": "git::StageAndNext", "alt-shift-y": "git::UnstageAndNext", "alt-.": "editor::GoToHunk", - "alt-,": "editor::GoToPrevHunk" + "alt-,": "editor::GoToPreviousHunk" } }, { @@ -419,14 +531,24 @@ "ctrl-alt-y": "workspace::CloseAllDocks", "shift-find": "pane::DeploySearch", "ctrl-shift-f": "pane::DeploySearch", - "ctrl-shift-h": ["pane::DeploySearch", { "replace_enabled": true }], + "ctrl-shift-h": [ + "pane::DeploySearch", + { + "replace_enabled": true + } + ], "ctrl-shift-t": "pane::ReopenClosedItem", "ctrl-k ctrl-s": "zed::OpenKeymap", "ctrl-k ctrl-t": "theme_selector::Toggle", "ctrl-t": "project_symbols::Toggle", "ctrl-p": "file_finder::Toggle", "ctrl-tab": "tab_switcher::Toggle", - "ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }], + "ctrl-shift-tab": [ + "tab_switcher::Toggle", + { + "select_last": true + } + ], "ctrl-e": "file_finder::Toggle", "f1": "command_palette::Toggle", "ctrl-shift-p": "command_palette::Toggle", @@ -452,7 +574,12 @@ "ctrl-alt-r": "task::Rerun", "alt-t": "task::Rerun", "alt-shift-t": "task::Spawn", - "alt-shift-r": ["task::Spawn", { "reveal_target": "center" }] + "alt-shift-r": [ + "task::Spawn", + { + "reveal_target": "center" + } + ] // also possible to spawn tasks by name: // "foo-bar": ["task::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }] } @@ -536,8 +663,8 @@ { "context": "Editor && (showing_code_actions || showing_completions)", "bindings": { - "ctrl-p": "editor::ContextMenuPrev", - "up": "editor::ContextMenuPrev", + "ctrl-p": "editor::ContextMenuPrevious", + "up": "editor::ContextMenuPrevious", "ctrl-n": "editor::ContextMenuNext", "down": "editor::ContextMenuNext", "pageup": "editor::ContextMenuFirst", @@ -565,7 +692,7 @@ "ctrl-alt-enter": "editor::OpenExcerptsSplit", "ctrl-shift-e": "pane::RevealInProjectPanel", "ctrl-f8": "editor::GoToHunk", - "ctrl-shift-f8": "editor::GoToPrevHunk", + "ctrl-shift-f8": "editor::GoToPreviousHunk", "ctrl-enter": "assistant::InlineAssist", "ctrl-:": "editor::ToggleInlayHints" } @@ -662,7 +789,7 @@ "alt-ctrl-r": "outline_panel::RevealInFileManager", "space": "outline_panel::Open", "shift-down": "menu::SelectNext", - "shift-up": "menu::SelectPrev", + "shift-up": "menu::SelectPrevious", "alt-enter": "editor::OpenExcerpts", "ctrl-alt-enter": "editor::OpenExcerptsSplit" } @@ -690,17 +817,42 @@ "alt-ctrl-shift-c": "workspace::CopyRelativePath", "enter": "project_panel::Rename", "f2": "project_panel::Rename", - "backspace": ["project_panel::Trash", { "skip_prompt": false }], - "delete": ["project_panel::Trash", { "skip_prompt": false }], - "shift-delete": ["project_panel::Delete", { "skip_prompt": false }], - "ctrl-backspace": ["project_panel::Delete", { "skip_prompt": false }], - "ctrl-delete": ["project_panel::Delete", { "skip_prompt": false }], + "backspace": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "delete": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "shift-delete": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], + "ctrl-backspace": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], + "ctrl-delete": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], "alt-ctrl-r": "project_panel::RevealInFileManager", "ctrl-shift-enter": "project_panel::OpenWithSystem", "shift-find": "project_panel::NewSearchInDirectory", "ctrl-shift-f": "project_panel::NewSearchInDirectory", "shift-down": "menu::SelectNext", - "shift-up": "menu::SelectPrev", + "shift-up": "menu::SelectPrevious", "escape": "menu::Cancel" } }, @@ -713,7 +865,7 @@ { "context": "GitPanel && ChangesList", "bindings": { - "up": "menu::SelectPrev", + "up": "menu::SelectPrevious", "down": "menu::SelectNext", "enter": "menu::Confirm", "space": "git::ToggleStaged", @@ -780,7 +932,12 @@ "context": "Picker > Editor", "bindings": { "tab": "picker::ConfirmCompletion", - "alt-enter": ["picker::ConfirmInput", { "secondary": false }] + "alt-enter": [ + "picker::ConfirmInput", + { + "secondary": false + } + ] } }, { @@ -792,7 +949,7 @@ { "context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)", "bindings": { - "ctrl-shift-p": "file_finder::SelectPrev", + "ctrl-shift-p": "file_finder::SelectPrevious", "ctrl-j": "pane::SplitDown", "ctrl-k": "pane::SplitUp", "ctrl-h": "pane::SplitLeft", @@ -802,8 +959,8 @@ { "context": "TabSwitcher", "bindings": { - "ctrl-shift-tab": "menu::SelectPrev", - "ctrl-up": "menu::SelectPrev", + "ctrl-shift-tab": "menu::SelectPrevious", + "ctrl-up": "menu::SelectPrevious", "ctrl-down": "menu::SelectNext", "ctrl-backspace": "tab_switcher::CloseSelectedItem" } diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index fe0667f740ef0f1c10c8a14a1bf890e494bfc5e0..779b63070d731fab7a4b1314ab16f986d5a35b62 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -14,9 +14,9 @@ "tab": "menu::SelectNext", "ctrl-n": "menu::SelectNext", "down": "menu::SelectNext", - "shift-tab": "menu::SelectPrev", - "ctrl-p": "menu::SelectPrev", - "up": "menu::SelectPrev", + "shift-tab": "menu::SelectPrevious", + "ctrl-p": "menu::SelectPrevious", + "up": "menu::SelectPrevious", "enter": "menu::Confirm", "ctrl-enter": "menu::SecondaryConfirm", "cmd-enter": "menu::SecondaryConfirm", @@ -28,10 +28,30 @@ "cmd-shift-w": "workspace::CloseWindow", "shift-escape": "workspace::ToggleZoom", "cmd-o": "workspace::Open", - "cmd-=": ["zed::IncreaseBufferFontSize", { "persist": false }], - "cmd-+": ["zed::IncreaseBufferFontSize", { "persist": false }], - "cmd--": ["zed::DecreaseBufferFontSize", { "persist": false }], - "cmd-0": ["zed::ResetBufferFontSize", { "persist": false }], + "cmd-=": [ + "zed::IncreaseBufferFontSize", + { + "persist": false + } + ], + "cmd-+": [ + "zed::IncreaseBufferFontSize", + { + "persist": false + } + ], + "cmd--": [ + "zed::DecreaseBufferFontSize", + { + "persist": false + } + ], + "cmd-0": [ + "zed::ResetBufferFontSize", + { + "persist": false + } + ], "cmd-,": "zed::OpenSettings", "cmd-q": "zed::Quit", "cmd-h": "zed::Hide", @@ -54,7 +74,7 @@ "ctrl-d": "editor::Delete", "delete": "editor::Delete", "tab": "editor::Tab", - "shift-tab": "editor::TabPrev", + "shift-tab": "editor::Backtab", "ctrl-t": "editor::Transpose", "ctrl-k": "editor::KillRingCut", "ctrl-y": "editor::KillRingYank", @@ -91,12 +111,45 @@ "ctrl-l": "editor::ScrollCursorCenter", "alt-left": "editor::MoveToPreviousWordStart", "alt-right": "editor::MoveToNextWordEnd", - "cmd-left": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false, "stop_at_indent": true }], - "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "cmd-right": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }], - "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }], - "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }], + "cmd-left": [ + "editor::MoveToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], + "ctrl-a": [ + "editor::MoveToBeginningOfLine", + { + "stop_at_soft_wraps": false, + "stop_at_indent": true + } + ], + "home": [ + "editor::MoveToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], + "cmd-right": [ + "editor::MoveToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], + "ctrl-e": [ + "editor::MoveToEndOfLine", + { + "stop_at_soft_wraps": false + } + ], + "end": [ + "editor::MoveToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], "cmd-up": "editor::MoveToStartOfExcerpt", "cmd-down": "editor::MoveToEndOfExcerpt", "cmd-home": "editor::MoveToBeginning", // Typed via `cmd-fn-left` @@ -118,14 +171,57 @@ "cmd-a": "editor::SelectAll", "cmd-l": "editor::SelectLine", "cmd-shift-i": "editor::Format", - "cmd-shift-left": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }], - "cmd-shift-right": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], - "shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], - "ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }], - "ctrl-v": ["editor::MovePageDown", { "center_cursor": true }], - "ctrl-shift-v": ["editor::MovePageUp", { "center_cursor": true }], + "cmd-shift-left": [ + "editor::SelectToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], + "shift-home": [ + "editor::SelectToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], + "ctrl-shift-a": [ + "editor::SelectToBeginningOfLine", + { + "stop_at_soft_wraps": true, + "stop_at_indent": true + } + ], + "cmd-shift-right": [ + "editor::SelectToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], + "shift-end": [ + "editor::SelectToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], + "ctrl-shift-e": [ + "editor::SelectToEndOfLine", + { + "stop_at_soft_wraps": true + } + ], + "ctrl-v": [ + "editor::MovePageDown", + { + "center_cursor": true + } + ], + "ctrl-shift-v": [ + "editor::MovePageUp", + { + "center_cursor": true + } + ], "ctrl-cmd-space": "editor::ShowCharacterPalette", "cmd-;": "editor::ToggleLineNumbers", "cmd-alt-z": "git::Restore", @@ -152,8 +248,18 @@ "cmd-k z": "editor::ToggleSoftWrap", "cmd-f": "buffer_search::Deploy", "cmd-alt-f": "buffer_search::DeployReplace", - "cmd-alt-l": ["buffer_search::Deploy", { "selection_search_enabled": true }], - "cmd-e": ["buffer_search::Deploy", { "focus": false }], + "cmd-alt-l": [ + "buffer_search::Deploy", + { + "selection_search_enabled": true + } + ], + "cmd-e": [ + "buffer_search::Deploy", + { + "focus": false + } + ], "cmd->": "assistant::QuoteSelection", "cmd-<": "assistant::InsertIntoEditor", "cmd-alt-e": "editor::SelectEnclosingSymbol", @@ -207,7 +313,7 @@ "cmd-k c": "assistant::CopyCode", "cmd-shift-e": "project_panel::ToggleFocus", "cmd-g": "search::SelectNextMatch", - "cmd-shift-g": "search::SelectPrevMatch", + "cmd-shift-g": "search::SelectPreviousMatch", "cmd-alt-/": "assistant::ToggleModelSelector", "cmd-k h": "assistant::DeployHistory", "cmd-k l": "assistant::DeployPromptLibrary", @@ -285,7 +391,7 @@ "escape": "buffer_search::Dismiss", "tab": "buffer_search::FocusEditor", "enter": "search::SelectNextMatch", - "shift-enter": "search::SelectPrevMatch", + "shift-enter": "search::SelectPreviousMatch", "alt-enter": "search::SelectAllMatches", "cmd-f": "search::FocusSearch", "cmd-alt-f": "search::ToggleReplace", @@ -358,16 +464,46 @@ "cmd-}": "pane::ActivateNextItem", "ctrl-shift-pageup": "pane::SwapItemLeft", "ctrl-shift-pagedown": "pane::SwapItemRight", - "cmd-w": ["pane::CloseActiveItem", { "close_pinned": false }], - "alt-cmd-t": ["pane::CloseInactiveItems", { "close_pinned": false }], + "cmd-w": [ + "pane::CloseActiveItem", + { + "close_pinned": false + } + ], + "alt-cmd-t": [ + "pane::CloseInactiveItems", + { + "close_pinned": false + } + ], "ctrl-alt-cmd-w": "workspace::CloseInactiveTabsAndPanes", - "cmd-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }], - "cmd-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }], - "cmd-k u": ["pane::CloseCleanItems", { "close_pinned": false }], - "cmd-k cmd-w": ["pane::CloseAllItems", { "close_pinned": false }], + "cmd-k e": [ + "pane::CloseItemsToTheLeft", + { + "close_pinned": false + } + ], + "cmd-k t": [ + "pane::CloseItemsToTheRight", + { + "close_pinned": false + } + ], + "cmd-k u": [ + "pane::CloseCleanItems", + { + "close_pinned": false + } + ], + "cmd-k cmd-w": [ + "pane::CloseAllItems", + { + "close_pinned": false + } + ], "cmd-f": "project_search::ToggleFocus", "cmd-g": "search::SelectNextMatch", - "cmd-shift-g": "search::SelectPrevMatch", + "cmd-shift-g": "search::SelectPreviousMatch", "cmd-shift-h": "search::ToggleReplace", "cmd-alt-l": "search::ToggleSelection", "alt-enter": "search::SelectAllMatches", @@ -396,18 +532,43 @@ "alt-shift-down": "editor::DuplicateLineDown", "ctrl-shift-right": "editor::SelectLargerSyntaxNode", // Expand Selection "ctrl-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection - "cmd-d": ["editor::SelectNext", { "replace_newest": false }], // Add selection to Next Find Match + "cmd-d": [ + "editor::SelectNext", + { + "replace_newest": false + } + ], // Add selection to Next Find Match "cmd-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection "cmd-f2": "editor::SelectAllMatches", // Select all occurrences of current word - "ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": false }], - "cmd-k cmd-d": ["editor::SelectNext", { "replace_newest": true }], - "cmd-k ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": true }], + "ctrl-cmd-d": [ + "editor::SelectPrevious", + { + "replace_newest": false + } + ], + "cmd-k cmd-d": [ + "editor::SelectNext", + { + "replace_newest": true + } + ], + "cmd-k ctrl-cmd-d": [ + "editor::SelectPrevious", + { + "replace_newest": true + } + ], "cmd-k cmd-i": "editor::Hover", - "cmd-/": ["editor::ToggleComments", { "advance_downwards": false }], + "cmd-/": [ + "editor::ToggleComments", + { + "advance_downwards": false + } + ], "cmd-u": "editor::UndoSelection", "cmd-shift-u": "editor::RedoSelection", "f8": "editor::GoToDiagnostic", - "shift-f8": "editor::GoToPrevDiagnostic", + "shift-f8": "editor::GoToPreviousDiagnostic", "f2": "editor::Rename", "f12": "editor::GoToDefinition", "alt-f12": "editor::GoToDefinitionSplit", @@ -422,15 +583,42 @@ "cmd-k cmd-l": "editor::ToggleFold", "cmd-k cmd-[": "editor::FoldRecursive", "cmd-k cmd-]": "editor::UnfoldRecursive", - "cmd-k cmd-1": ["editor::FoldAtLevel", 1], - "cmd-k cmd-2": ["editor::FoldAtLevel", 2], - "cmd-k cmd-3": ["editor::FoldAtLevel", 3], - "cmd-k cmd-4": ["editor::FoldAtLevel", 4], - "cmd-k cmd-5": ["editor::FoldAtLevel", 5], - "cmd-k cmd-6": ["editor::FoldAtLevel", 6], - "cmd-k cmd-7": ["editor::FoldAtLevel", 7], - "cmd-k cmd-8": ["editor::FoldAtLevel", 8], - "cmd-k cmd-9": ["editor::FoldAtLevel", 9], + "cmd-k cmd-1": [ + "editor::FoldAtLevel", + 1 + ], + "cmd-k cmd-2": [ + "editor::FoldAtLevel", + 2 + ], + "cmd-k cmd-3": [ + "editor::FoldAtLevel", + 3 + ], + "cmd-k cmd-4": [ + "editor::FoldAtLevel", + 4 + ], + "cmd-k cmd-5": [ + "editor::FoldAtLevel", + 5 + ], + "cmd-k cmd-6": [ + "editor::FoldAtLevel", + 6 + ], + "cmd-k cmd-7": [ + "editor::FoldAtLevel", + 7 + ], + "cmd-k cmd-8": [ + "editor::FoldAtLevel", + 8 + ], + "cmd-k cmd-9": [ + "editor::FoldAtLevel", + 9 + ], "cmd-k cmd-0": "editor::FoldAll", "cmd-k cmd-j": "editor::UnfoldAll", // Using `ctrl-space` in Zed requires disabling the macOS global shortcut. @@ -457,15 +645,42 @@ "context": "Pane", "use_key_equivalents": true, "bindings": { - "ctrl-1": ["pane::ActivateItem", 0], - "ctrl-2": ["pane::ActivateItem", 1], - "ctrl-3": ["pane::ActivateItem", 2], - "ctrl-4": ["pane::ActivateItem", 3], - "ctrl-5": ["pane::ActivateItem", 4], - "ctrl-6": ["pane::ActivateItem", 5], - "ctrl-7": ["pane::ActivateItem", 6], - "ctrl-8": ["pane::ActivateItem", 7], - "ctrl-9": ["pane::ActivateItem", 8], + "ctrl-1": [ + "pane::ActivateItem", + 0 + ], + "ctrl-2": [ + "pane::ActivateItem", + 1 + ], + "ctrl-3": [ + "pane::ActivateItem", + 2 + ], + "ctrl-4": [ + "pane::ActivateItem", + 3 + ], + "ctrl-5": [ + "pane::ActivateItem", + 4 + ], + "ctrl-6": [ + "pane::ActivateItem", + 5 + ], + "ctrl-7": [ + "pane::ActivateItem", + 6 + ], + "ctrl-8": [ + "pane::ActivateItem", + 7 + ], + "ctrl-9": [ + "pane::ActivateItem", + 8 + ], "ctrl-0": "pane::ActivateLastItem", "ctrl--": "pane::GoBack", "ctrl-_": "pane::GoForward", @@ -487,28 +702,65 @@ "cmd-shift-s": "workspace::SaveAs", "cmd-shift-n": "workspace::NewWindow", "ctrl-`": "terminal_panel::ToggleFocus", - "cmd-1": ["workspace::ActivatePane", 0], - "cmd-2": ["workspace::ActivatePane", 1], - "cmd-3": ["workspace::ActivatePane", 2], - "cmd-4": ["workspace::ActivatePane", 3], - "cmd-5": ["workspace::ActivatePane", 4], - "cmd-6": ["workspace::ActivatePane", 5], - "cmd-7": ["workspace::ActivatePane", 6], - "cmd-8": ["workspace::ActivatePane", 7], - "cmd-9": ["workspace::ActivatePane", 8], + "cmd-1": [ + "workspace::ActivatePane", + 0 + ], + "cmd-2": [ + "workspace::ActivatePane", + 1 + ], + "cmd-3": [ + "workspace::ActivatePane", + 2 + ], + "cmd-4": [ + "workspace::ActivatePane", + 3 + ], + "cmd-5": [ + "workspace::ActivatePane", + 4 + ], + "cmd-6": [ + "workspace::ActivatePane", + 5 + ], + "cmd-7": [ + "workspace::ActivatePane", + 6 + ], + "cmd-8": [ + "workspace::ActivatePane", + 7 + ], + "cmd-9": [ + "workspace::ActivatePane", + 8 + ], "cmd-b": "workspace::ToggleLeftDock", "cmd-r": "workspace::ToggleRightDock", "cmd-j": "workspace::ToggleBottomDock", "alt-cmd-y": "workspace::CloseAllDocks", "cmd-shift-f": "pane::DeploySearch", - "cmd-shift-h": ["pane::DeploySearch", { "replace_enabled": true }], + "cmd-shift-h": [ + "pane::DeploySearch", + { + "replace_enabled": true + } + ], "cmd-shift-t": "pane::ReopenClosedItem", "cmd-k cmd-s": "zed::OpenKeymap", "cmd-k cmd-t": "theme_selector::Toggle", "cmd-t": "project_symbols::Toggle", "cmd-p": "file_finder::Toggle", "ctrl-tab": "tab_switcher::Toggle", - "ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }], + "ctrl-shift-tab": [ + "tab_switcher::Toggle", + { + "select_last": true + } + ], "cmd-shift-p": "command_palette::Toggle", "cmd-shift-m": "diagnostics::Deploy", "cmd-shift-e": "project_panel::ToggleFocus", @@ -536,7 +788,12 @@ "cmd-n": "workspace::NewFile", "cmd-shift-r": "task::Spawn", "cmd-alt-r": "task::Rerun", - "ctrl-alt-shift-r": ["task::Spawn", { "reveal_target": "center" }] + "ctrl-alt-shift-r": [ + "task::Spawn", + { + "reveal_target": "center" + } + ] // also possible to spawn tasks by name: // "foo-bar": ["task::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }] } @@ -613,8 +870,8 @@ "context": "Editor && (showing_code_actions || showing_completions)", "use_key_equivalents": true, "bindings": { - "up": "editor::ContextMenuPrev", - "ctrl-p": "editor::ContextMenuPrev", + "up": "editor::ContextMenuPrevious", + "ctrl-p": "editor::ContextMenuPrevious", "down": "editor::ContextMenuNext", "ctrl-n": "editor::ContextMenuNext", "pageup": "editor::ContextMenuFirst", @@ -640,7 +897,7 @@ "cmd-alt-enter": "editor::OpenExcerptsSplit", "cmd-shift-e": "pane::RevealInProjectPanel", "cmd-f8": "editor::GoToHunk", - "cmd-shift-f8": "editor::GoToPrevHunk", + "cmd-shift-f8": "editor::GoToPreviousHunk", "ctrl-enter": "assistant::InlineAssist", "ctrl-:": "editor::ToggleInlayHints" } @@ -683,7 +940,7 @@ "alt-cmd-r": "outline_panel::RevealInFileManager", "space": "outline_panel::Open", "shift-down": "menu::SelectNext", - "shift-up": "menu::SelectPrev", + "shift-up": "menu::SelectPrevious", "alt-enter": "editor::OpenExcerpts", "cmd-alt-enter": "editor::OpenExcerptsSplit" } @@ -704,16 +961,41 @@ "alt-cmd-shift-c": "workspace::CopyRelativePath", "enter": "project_panel::Rename", "f2": "project_panel::Rename", - "backspace": ["project_panel::Trash", { "skip_prompt": false }], - "delete": ["project_panel::Trash", { "skip_prompt": false }], - "cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }], - "cmd-delete": ["project_panel::Delete", { "skip_prompt": false }], + "backspace": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "delete": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "cmd-backspace": [ + "project_panel::Trash", + { + "skip_prompt": true + } + ], + "cmd-delete": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], "alt-cmd-r": "project_panel::RevealInFileManager", "ctrl-shift-enter": "project_panel::OpenWithSystem", - "cmd-alt-backspace": ["project_panel::Delete", { "skip_prompt": false }], + "cmd-alt-backspace": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], "cmd-shift-f": "project_panel::NewSearchInDirectory", "shift-down": "menu::SelectNext", - "shift-up": "menu::SelectPrev", + "shift-up": "menu::SelectPrevious", "escape": "menu::Cancel" } }, @@ -728,7 +1010,7 @@ "context": "GitPanel && ChangesList", "use_key_equivalents": true, "bindings": { - "up": "menu::SelectPrev", + "up": "menu::SelectPrevious", "down": "menu::SelectNext", "cmd-up": "menu::SelectFirst", "cmd-down": "menu::SelectLast", @@ -796,8 +1078,18 @@ "use_key_equivalents": true, "bindings": { "tab": "picker::ConfirmCompletion", - "alt-enter": ["picker::ConfirmInput", { "secondary": false }], - "cmd-alt-enter": ["picker::ConfirmInput", { "secondary": true }] + "alt-enter": [ + "picker::ConfirmInput", + { + "secondary": false + } + ], + "cmd-alt-enter": [ + "picker::ConfirmInput", + { + "secondary": true + } + ] } }, { @@ -811,7 +1103,7 @@ "context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)", "use_key_equivalents": true, "bindings": { - "cmd-shift-p": "file_finder::SelectPrev", + "cmd-shift-p": "file_finder::SelectPrevious", "cmd-j": "pane::SplitDown", "cmd-k": "pane::SplitUp", "cmd-h": "pane::SplitLeft", @@ -822,8 +1114,8 @@ "context": "TabSwitcher", "use_key_equivalents": true, "bindings": { - "ctrl-shift-tab": "menu::SelectPrev", - "ctrl-up": "menu::SelectPrev", + "ctrl-shift-tab": "menu::SelectPrevious", + "ctrl-up": "menu::SelectPrevious", "ctrl-down": "menu::SelectNext", "ctrl-backspace": "tab_switcher::CloseSelectedItem" } @@ -841,23 +1133,65 @@ "ctrl-enter": "assistant::InlineAssist", "ctrl-_": null, // emacs undo // Some nice conveniences - "cmd-backspace": ["terminal::SendText", "\u0015"], - "cmd-right": ["terminal::SendText", "\u0005"], - "cmd-left": ["terminal::SendText", "\u0001"], + "cmd-backspace": [ + "terminal::SendText", + "\u0015" + ], + "cmd-right": [ + "terminal::SendText", + "\u0005" + ], + "cmd-left": [ + "terminal::SendText", + "\u0001" + ], // Terminal.app compatibility - "alt-left": ["terminal::SendText", "\u001bb"], - "alt-right": ["terminal::SendText", "\u001bf"], - "alt-b": ["terminal::SendText", "\u001bb"], - "alt-f": ["terminal::SendText", "\u001bf"], + "alt-left": [ + "terminal::SendText", + "\u001bb" + ], + "alt-right": [ + "terminal::SendText", + "\u001bf" + ], + "alt-b": [ + "terminal::SendText", + "\u001bb" + ], + "alt-f": [ + "terminal::SendText", + "\u001bf" + ], // There are conflicting bindings for these keys in the global context. // these bindings override them, remove at your own risk: - "up": ["terminal::SendKeystroke", "up"], - "pageup": ["terminal::SendKeystroke", "pageup"], - "down": ["terminal::SendKeystroke", "down"], - "pagedown": ["terminal::SendKeystroke", "pagedown"], - "escape": ["terminal::SendKeystroke", "escape"], - "enter": ["terminal::SendKeystroke", "enter"], - "ctrl-c": ["terminal::SendKeystroke", "ctrl-c"], + "up": [ + "terminal::SendKeystroke", + "up" + ], + "pageup": [ + "terminal::SendKeystroke", + "pageup" + ], + "down": [ + "terminal::SendKeystroke", + "down" + ], + "pagedown": [ + "terminal::SendKeystroke", + "pagedown" + ], + "escape": [ + "terminal::SendKeystroke", + "escape" + ], + "enter": [ + "terminal::SendKeystroke", + "enter" + ], + "ctrl-c": [ + "terminal::SendKeystroke", + "ctrl-c" + ], "shift-pageup": "terminal::ScrollPageUp", "cmd-up": "terminal::ScrollPageUp", "shift-pagedown": "terminal::ScrollPageDown", @@ -902,4 +1236,4 @@ "escape": "menu::Cancel" } } -] +] \ No newline at end of file diff --git a/assets/keymaps/linux/atom.json b/assets/keymaps/linux/atom.json index 05caf32bcb9bff7383c124004e4082524d841c5f..d471a54ea59b31ff713e7220d090b40c94d150ba 100644 --- a/assets/keymaps/linux/atom.json +++ b/assets/keymaps/linux/atom.json @@ -39,7 +39,7 @@ "context": "BufferSearchBar", "bindings": { "ctrl-f3": "search::SelectNextMatch", // find-and-replace:find-next-selected - "ctrl-shift-f3": "search::SelectPrevMatch" // find-and-replace:find-previous-selected + "ctrl-shift-f3": "search::SelectPreviousMatch" // find-and-replace:find-previous-selected } }, { diff --git a/assets/keymaps/linux/emacs.json b/assets/keymaps/linux/emacs.json index 4a0f55fd063a8804aa50ac217205ac8896060801..e55929a06c023fda3522a815777966e75da82313 100755 --- a/assets/keymaps/linux/emacs.json +++ b/assets/keymaps/linux/emacs.json @@ -122,7 +122,7 @@ "context": "BufferSearchBar > Editor", "bindings": { "ctrl-s": "search::SelectNextMatch", - "ctrl-r": "search::SelectPrevMatch", + "ctrl-r": "search::SelectPreviousMatch", "ctrl-g": "buffer_search::Dismiss" } }, diff --git a/assets/keymaps/linux/jetbrains.json b/assets/keymaps/linux/jetbrains.json index 39f9c98d9d4b5ca39f591fec90f2b36eab9f2274..7fd4ebeafade9512b00e19dfa57eef1af55f8abb 100644 --- a/assets/keymaps/linux/jetbrains.json +++ b/assets/keymaps/linux/jetbrains.json @@ -9,8 +9,18 @@ { "context": "Editor", "bindings": { - "ctrl->": ["zed::IncreaseBufferFontSize", { "persist": true }], - "ctrl-<": ["zed::DecreaseBufferFontSize", { "persist": true }], + "ctrl->": [ + "zed::IncreaseBufferFontSize", + { + "persist": true + } + ], + "ctrl-<": [ + "zed::DecreaseBufferFontSize", + { + "persist": true + } + ], "ctrl-shift-j": "editor::JoinLines", "ctrl-d": "editor::DuplicateSelection", "ctrl-y": "editor::DeleteLine", @@ -23,9 +33,24 @@ // "ctrl--": "editor::Fold", // TODO: `ctrl-numpad--` (numpad not implemented) // "ctrl-+": "editor::UnfoldLines", // TODO: `ctrl-numpad+` (numpad not implemented) "alt-shift-g": "editor::SplitSelectionIntoLines", - "alt-j": ["editor::SelectNext", { "replace_newest": false }], - "alt-shift-j": ["editor::SelectPrevious", { "replace_newest": false }], - "ctrl-/": ["editor::ToggleComments", { "advance_downwards": true }], + "alt-j": [ + "editor::SelectNext", + { + "replace_newest": false + } + ], + "alt-shift-j": [ + "editor::SelectPrevious", + { + "replace_newest": false + } + ], + "ctrl-/": [ + "editor::ToggleComments", + { + "advance_downwards": true + } + ], "ctrl-w": "editor::SelectLargerSyntaxNode", "ctrl-shift-w": "editor::SelectSmallerSyntaxNode", "shift-alt-up": "editor::MoveLineUp", @@ -41,9 +66,9 @@ "ctrl-shift-b": "editor::GoToTypeDefinition", "ctrl-alt-shift-b": "editor::GoToTypeDefinitionSplit", "f2": "editor::GoToDiagnostic", - "shift-f2": "editor::GoToPrevDiagnostic", + "shift-f2": "editor::GoToPreviousDiagnostic", "ctrl-alt-shift-down": "editor::GoToHunk", - "ctrl-alt-shift-up": "editor::GoToPrevHunk", + "ctrl-alt-shift-up": "editor::GoToPreviousHunk", "ctrl-alt-z": "git::Restore", "ctrl-home": "editor::MoveToBeginning", "ctrl-end": "editor::MoveToEnd", @@ -84,10 +109,25 @@ "context": "ProjectPanel", "bindings": { "enter": "project_panel::Open", - "backspace": ["project_panel::Trash", { "skip_prompt": false }], - "delete": ["project_panel::Trash", { "skip_prompt": false }], - "shift-delete": ["project_panel::Delete", { "skip_prompt": false }], + "backspace": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "delete": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "shift-delete": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], "shift-f6": "project_panel::Rename" } } -] +] \ No newline at end of file diff --git a/assets/keymaps/linux/sublime_text.json b/assets/keymaps/linux/sublime_text.json index 3e61cc7c9dbe767a87628c8cf75f2eb21b030f6a..71c04b83cbec1fce63d026bf6917fa69b712bd31 100644 --- a/assets/keymaps/linux/sublime_text.json +++ b/assets/keymaps/linux/sublime_text.json @@ -5,24 +5,97 @@ "ctrl-}": "pane::ActivateNextItem", "ctrl-pageup": "pane::ActivatePrevItem", "ctrl-pagedown": "pane::ActivateNextItem", - "ctrl-1": ["workspace::ActivatePane", 0], - "ctrl-2": ["workspace::ActivatePane", 1], - "ctrl-3": ["workspace::ActivatePane", 2], - "ctrl-4": ["workspace::ActivatePane", 3], - "ctrl-5": ["workspace::ActivatePane", 4], - "ctrl-6": ["workspace::ActivatePane", 5], - "ctrl-7": ["workspace::ActivatePane", 6], - "ctrl-8": ["workspace::ActivatePane", 7], - "ctrl-9": ["workspace::ActivatePane", 8], - "ctrl-!": ["workspace::MoveItemToPane", { "destination": 0, "focus": true }], - "ctrl-@": ["workspace::MoveItemToPane", { "destination": 1 }], - "ctrl-#": ["workspace::MoveItemToPane", { "destination": 2 }], - "ctrl-$": ["workspace::MoveItemToPane", { "destination": 3 }], - "ctrl-%": ["workspace::MoveItemToPane", { "destination": 4 }], - "ctrl-^": ["workspace::MoveItemToPane", { "destination": 5 }], - "ctrl-&": ["workspace::MoveItemToPane", { "destination": 6 }], - "ctrl-*": ["workspace::MoveItemToPane", { "destination": 7 }], - "ctrl-(": ["workspace::MoveItemToPane", { "destination": 8 }] + "ctrl-1": [ + "workspace::ActivatePane", + 0 + ], + "ctrl-2": [ + "workspace::ActivatePane", + 1 + ], + "ctrl-3": [ + "workspace::ActivatePane", + 2 + ], + "ctrl-4": [ + "workspace::ActivatePane", + 3 + ], + "ctrl-5": [ + "workspace::ActivatePane", + 4 + ], + "ctrl-6": [ + "workspace::ActivatePane", + 5 + ], + "ctrl-7": [ + "workspace::ActivatePane", + 6 + ], + "ctrl-8": [ + "workspace::ActivatePane", + 7 + ], + "ctrl-9": [ + "workspace::ActivatePane", + 8 + ], + "ctrl-!": [ + "workspace::MoveItemToPane", + { + "destination": 0, + "focus": true + } + ], + "ctrl-@": [ + "workspace::MoveItemToPane", + { + "destination": 1 + } + ], + "ctrl-#": [ + "workspace::MoveItemToPane", + { + "destination": 2 + } + ], + "ctrl-$": [ + "workspace::MoveItemToPane", + { + "destination": 3 + } + ], + "ctrl-%": [ + "workspace::MoveItemToPane", + { + "destination": 4 + } + ], + "ctrl-^": [ + "workspace::MoveItemToPane", + { + "destination": 5 + } + ], + "ctrl-&": [ + "workspace::MoveItemToPane", + { + "destination": 6 + } + ], + "ctrl-*": [ + "workspace::MoveItemToPane", + { + "destination": 7 + } + ], + "ctrl-(": [ + "workspace::MoveItemToPane", + { + "destination": 8 + } + ] } }, { @@ -44,7 +117,7 @@ "shift-f12": "editor::FindAllReferences", "ctrl-shift-f12": "editor::FindAllReferences", "ctrl-.": "editor::GoToHunk", - "ctrl-,": "editor::GoToPrevHunk", + "ctrl-,": "editor::GoToPreviousHunk", "ctrl-k ctrl-u": "editor::ConvertToUpperCase", "ctrl-k ctrl-l": "editor::ConvertToLowerCase", "shift-alt-m": "markdown::OpenPreviewToTheSide", @@ -62,15 +135,39 @@ "context": "Pane", "bindings": { "f4": "search::SelectNextMatch", - "shift-f4": "search::SelectPrevMatch", - "alt-1": ["pane::ActivateItem", 0], - "alt-2": ["pane::ActivateItem", 1], - "alt-3": ["pane::ActivateItem", 2], - "alt-4": ["pane::ActivateItem", 3], - "alt-5": ["pane::ActivateItem", 4], - "alt-6": ["pane::ActivateItem", 5], - "alt-7": ["pane::ActivateItem", 6], - "alt-8": ["pane::ActivateItem", 7], + "shift-f4": "search::SelectPreviousMatch", + "alt-1": [ + "pane::ActivateItem", + 0 + ], + "alt-2": [ + "pane::ActivateItem", + 1 + ], + "alt-3": [ + "pane::ActivateItem", + 2 + ], + "alt-4": [ + "pane::ActivateItem", + 3 + ], + "alt-5": [ + "pane::ActivateItem", + 4 + ], + "alt-6": [ + "pane::ActivateItem", + 5 + ], + "alt-7": [ + "pane::ActivateItem", + 6 + ], + "alt-8": [ + "pane::ActivateItem", + 7 + ], "alt-9": "pane::ActivateLastItem" } }, @@ -82,4 +179,4 @@ "shift-ctrl-r": "project_symbols::Toggle" } } -] +] \ No newline at end of file diff --git a/assets/keymaps/macos/atom.json b/assets/keymaps/macos/atom.json index 04f07f421f974c69bb8c1e5aabb6d3990fce7757..9ddf3538103136d62a51621bfebe99b1c4271267 100644 --- a/assets/keymaps/macos/atom.json +++ b/assets/keymaps/macos/atom.json @@ -40,7 +40,7 @@ "context": "BufferSearchBar", "bindings": { "cmd-f3": "search::SelectNextMatch", - "cmd-shift-f3": "search::SelectPrevMatch" + "cmd-shift-f3": "search::SelectPreviousMatch" } }, { diff --git a/assets/keymaps/macos/emacs.json b/assets/keymaps/macos/emacs.json index 4a0f55fd063a8804aa50ac217205ac8896060801..e55929a06c023fda3522a815777966e75da82313 100755 --- a/assets/keymaps/macos/emacs.json +++ b/assets/keymaps/macos/emacs.json @@ -122,7 +122,7 @@ "context": "BufferSearchBar > Editor", "bindings": { "ctrl-s": "search::SelectNextMatch", - "ctrl-r": "search::SelectPrevMatch", + "ctrl-r": "search::SelectPreviousMatch", "ctrl-g": "buffer_search::Dismiss" } }, diff --git a/assets/keymaps/macos/jetbrains.json b/assets/keymaps/macos/jetbrains.json index 66c2262b85425481003d8bfe0d516b3050aa679b..59a2ad87cd6d91c84308ecfdbd905100c9871af3 100644 --- a/assets/keymaps/macos/jetbrains.json +++ b/assets/keymaps/macos/jetbrains.json @@ -8,8 +8,18 @@ { "context": "Editor", "bindings": { - "ctrl->": ["zed::IncreaseBufferFontSize", { "persist": true }], - "ctrl-<": ["zed::DecreaseBufferFontSize", { "persist": true }], + "ctrl->": [ + "zed::IncreaseBufferFontSize", + { + "persist": true + } + ], + "ctrl-<": [ + "zed::DecreaseBufferFontSize", + { + "persist": true + } + ], "ctrl-shift-j": "editor::JoinLines", "cmd-d": "editor::DuplicateSelection", "cmd-backspace": "editor::DeleteLine", @@ -21,9 +31,24 @@ "cmd--": "editor::Fold", "cmd-+": "editor::UnfoldLines", "alt-shift-g": "editor::SplitSelectionIntoLines", - "ctrl-g": ["editor::SelectNext", { "replace_newest": false }], - "ctrl-cmd-g": ["editor::SelectPrevious", { "replace_newest": false }], - "cmd-/": ["editor::ToggleComments", { "advance_downwards": true }], + "ctrl-g": [ + "editor::SelectNext", + { + "replace_newest": false + } + ], + "ctrl-cmd-g": [ + "editor::SelectPrevious", + { + "replace_newest": false + } + ], + "cmd-/": [ + "editor::ToggleComments", + { + "advance_downwards": true + } + ], "alt-up": "editor::SelectLargerSyntaxNode", "alt-down": "editor::SelectSmallerSyntaxNode", "shift-alt-up": "editor::MoveLineUp", @@ -39,9 +64,9 @@ "cmd-shift-b": "editor::GoToTypeDefinition", "cmd-alt-shift-b": "editor::GoToTypeDefinitionSplit", "f2": "editor::GoToDiagnostic", - "shift-f2": "editor::GoToPrevDiagnostic", + "shift-f2": "editor::GoToPreviousDiagnostic", "ctrl-alt-shift-down": "editor::GoToHunk", - "ctrl-alt-shift-up": "editor::GoToPrevHunk", + "ctrl-alt-shift-up": "editor::GoToPreviousHunk", "cmd-home": "editor::MoveToBeginning", "cmd-end": "editor::MoveToEnd", "cmd-shift-home": "editor::SelectToBeginning", @@ -61,7 +86,7 @@ { "context": "BufferSearchBar > Editor", "bindings": { - "shift-enter": "search::SelectPrevMatch" + "shift-enter": "search::SelectPreviousMatch" } }, { @@ -87,10 +112,30 @@ "context": "ProjectPanel", "bindings": { "enter": "project_panel::Open", - "cmd-backspace": ["project_panel::Trash", { "skip_prompt": false }], - "backspace": ["project_panel::Trash", { "skip_prompt": false }], - "delete": ["project_panel::Trash", { "skip_prompt": false }], - "shift-delete": ["project_panel::Delete", { "skip_prompt": false }], + "cmd-backspace": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "backspace": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "delete": [ + "project_panel::Trash", + { + "skip_prompt": false + } + ], + "shift-delete": [ + "project_panel::Delete", + { + "skip_prompt": false + } + ], "shift-f6": "project_panel::Rename" } } diff --git a/assets/keymaps/macos/sublime_text.json b/assets/keymaps/macos/sublime_text.json index 445de8899072384ac5ed6c9a0ee4e65073cf006a..ea55baba3ef33b4691ea63554838c1757d5a9d74 100644 --- a/assets/keymaps/macos/sublime_text.json +++ b/assets/keymaps/macos/sublime_text.json @@ -5,24 +5,97 @@ "cmd-}": "pane::ActivateNextItem", "ctrl-pageup": "pane::ActivatePrevItem", "ctrl-pagedown": "pane::ActivateNextItem", - "ctrl-1": ["workspace::ActivatePane", 0], - "ctrl-2": ["workspace::ActivatePane", 1], - "ctrl-3": ["workspace::ActivatePane", 2], - "ctrl-4": ["workspace::ActivatePane", 3], - "ctrl-5": ["workspace::ActivatePane", 4], - "ctrl-6": ["workspace::ActivatePane", 5], - "ctrl-7": ["workspace::ActivatePane", 6], - "ctrl-8": ["workspace::ActivatePane", 7], - "ctrl-9": ["workspace::ActivatePane", 8], - "ctrl-!": ["workspace::MoveItemToPane", { "destination": 0, "focus": true }], - "ctrl-@": ["workspace::MoveItemToPane", { "destination": 1 }], - "ctrl-#": ["workspace::MoveItemToPane", { "destination": 2 }], - "ctrl-$": ["workspace::MoveItemToPane", { "destination": 3 }], - "ctrl-%": ["workspace::MoveItemToPane", { "destination": 4 }], - "ctrl-^": ["workspace::MoveItemToPane", { "destination": 5 }], - "ctrl-&": ["workspace::MoveItemToPane", { "destination": 6 }], - "ctrl-*": ["workspace::MoveItemToPane", { "destination": 7 }], - "ctrl-(": ["workspace::MoveItemToPane", { "destination": 8 }] + "ctrl-1": [ + "workspace::ActivatePane", + 0 + ], + "ctrl-2": [ + "workspace::ActivatePane", + 1 + ], + "ctrl-3": [ + "workspace::ActivatePane", + 2 + ], + "ctrl-4": [ + "workspace::ActivatePane", + 3 + ], + "ctrl-5": [ + "workspace::ActivatePane", + 4 + ], + "ctrl-6": [ + "workspace::ActivatePane", + 5 + ], + "ctrl-7": [ + "workspace::ActivatePane", + 6 + ], + "ctrl-8": [ + "workspace::ActivatePane", + 7 + ], + "ctrl-9": [ + "workspace::ActivatePane", + 8 + ], + "ctrl-!": [ + "workspace::MoveItemToPane", + { + "destination": 0, + "focus": true + } + ], + "ctrl-@": [ + "workspace::MoveItemToPane", + { + "destination": 1 + } + ], + "ctrl-#": [ + "workspace::MoveItemToPane", + { + "destination": 2 + } + ], + "ctrl-$": [ + "workspace::MoveItemToPane", + { + "destination": 3 + } + ], + "ctrl-%": [ + "workspace::MoveItemToPane", + { + "destination": 4 + } + ], + "ctrl-^": [ + "workspace::MoveItemToPane", + { + "destination": 5 + } + ], + "ctrl-&": [ + "workspace::MoveItemToPane", + { + "destination": 6 + } + ], + "ctrl-*": [ + "workspace::MoveItemToPane", + { + "destination": 7 + } + ], + "ctrl-(": [ + "workspace::MoveItemToPane", + { + "destination": 8 + } + ] } }, { @@ -45,7 +118,7 @@ "ctrl-alt-cmd-down": "editor::GoToDefinitionSplit", "alt-shift-cmd-down": "editor::FindAllReferences", "ctrl-.": "editor::GoToHunk", - "ctrl-,": "editor::GoToPrevHunk", + "ctrl-,": "editor::GoToPreviousHunk", "cmd-k cmd-u": "editor::ConvertToUpperCase", "cmd-k cmd-l": "editor::ConvertToLowerCase", "cmd-shift-j": "editor::JoinLines", @@ -64,15 +137,39 @@ "context": "Pane", "bindings": { "f4": "search::SelectNextMatch", - "shift-f4": "search::SelectPrevMatch", - "cmd-1": ["pane::ActivateItem", 0], - "cmd-2": ["pane::ActivateItem", 1], - "cmd-3": ["pane::ActivateItem", 2], - "cmd-4": ["pane::ActivateItem", 3], - "cmd-5": ["pane::ActivateItem", 4], - "cmd-6": ["pane::ActivateItem", 5], - "cmd-7": ["pane::ActivateItem", 6], - "cmd-8": ["pane::ActivateItem", 7], + "shift-f4": "search::SelectPreviousMatch", + "cmd-1": [ + "pane::ActivateItem", + 0 + ], + "cmd-2": [ + "pane::ActivateItem", + 1 + ], + "cmd-3": [ + "pane::ActivateItem", + 2 + ], + "cmd-4": [ + "pane::ActivateItem", + 3 + ], + "cmd-5": [ + "pane::ActivateItem", + 4 + ], + "cmd-6": [ + "pane::ActivateItem", + 5 + ], + "cmd-7": [ + "pane::ActivateItem", + 6 + ], + "cmd-8": [ + "pane::ActivateItem", + 7 + ], "cmd-9": "pane::ActivateLastItem" } }, @@ -86,4 +183,4 @@ "ctrl-0": "project_panel::ToggleFocus" } } -] +] \ No newline at end of file diff --git a/assets/keymaps/macos/textmate.json b/assets/keymaps/macos/textmate.json index 90d3510abc0dab629be442855c8fa7887ccf8be5..dccb675f6c9734c6da3b797cae199037591085fc 100644 --- a/assets/keymaps/macos/textmate.json +++ b/assets/keymaps/macos/textmate.json @@ -47,7 +47,7 @@ "context": "BufferSearchBar", "bindings": { "ctrl-s": "search::SelectNextMatch", - "ctrl-shift-s": "search::SelectPrevMatch" + "ctrl-shift-s": "search::SelectPreviousMatch" } }, { diff --git a/assets/keymaps/storybook.json b/assets/keymaps/storybook.json index a59e084a8833a8cd6afea757a39ce2c596a4495a..9b92fbe1a3844043e379647d1dd6c57e082fdf77 100644 --- a/assets/keymaps/storybook.json +++ b/assets/keymaps/storybook.json @@ -13,9 +13,9 @@ "tab": "menu::SelectNext", "ctrl-n": "menu::SelectNext", "down": "menu::SelectNext", - "shift-tab": "menu::SelectPrev", - "ctrl-p": "menu::SelectPrev", - "up": "menu::SelectPrev", + "shift-tab": "menu::SelectPrevious", + "ctrl-p": "menu::SelectPrevious", + "up": "menu::SelectPrevious", "enter": "menu::Confirm", "ctrl-enter": "menu::SecondaryConfirm", "cmd-enter": "menu::SecondaryConfirm", diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json index b2107c795495cc277d6d514339b0c387779082ee..ee2ac1aef66f74c56f5af21532ab25435d2313bd 100644 --- a/assets/keymaps/vim.json +++ b/assets/keymaps/vim.json @@ -2,8 +2,18 @@ { "context": "VimControl && !menu", "bindings": { - "i": ["vim::PushObject", { "around": false }], - "a": ["vim::PushObject", { "around": true }], + "i": [ + "vim::PushObject", + { + "around": false + } + ], + "a": [ + "vim::PushObject", + { + "around": true + } + ], "left": "vim::Left", "h": "vim::Left", "backspace": "vim::Backspace", @@ -54,29 +64,104 @@ // "b": "vim::PreviousSubwordStart", // "e": "vim::NextSubwordEnd", // "g e": "vim::PreviousSubwordEnd", - "shift-w": ["vim::NextWordStart", { "ignore_punctuation": true }], - "shift-e": ["vim::NextWordEnd", { "ignore_punctuation": true }], - "shift-b": ["vim::PreviousWordStart", { "ignore_punctuation": true }], - "g shift-e": ["vim::PreviousWordEnd", { "ignore_punctuation": true }], + "shift-w": [ + "vim::NextWordStart", + { + "ignore_punctuation": true + } + ], + "shift-e": [ + "vim::NextWordEnd", + { + "ignore_punctuation": true + } + ], + "shift-b": [ + "vim::PreviousWordStart", + { + "ignore_punctuation": true + } + ], + "g shift-e": [ + "vim::PreviousWordEnd", + { + "ignore_punctuation": true + } + ], "/": "vim::Search", "g /": "pane::DeploySearch", - "?": ["vim::Search", { "backwards": true }], + "?": [ + "vim::Search", + { + "backwards": true + } + ], "*": "vim::MoveToNext", "#": "vim::MoveToPrev", "n": "vim::MoveToNextMatch", "shift-n": "vim::MoveToPrevMatch", "%": "vim::Matching", - "] }": ["vim::UnmatchedForward", { "char": "}" }], - "[ {": ["vim::UnmatchedBackward", { "char": "{" }], - "] )": ["vim::UnmatchedForward", { "char": ")" }], - "[ (": ["vim::UnmatchedBackward", { "char": "(" }], - "f": ["vim::PushFindForward", { "before": false }], - "t": ["vim::PushFindForward", { "before": true }], - "shift-f": ["vim::PushFindBackward", { "after": false }], - "shift-t": ["vim::PushFindBackward", { "after": true }], + "] }": [ + "vim::UnmatchedForward", + { + "char": "}" + } + ], + "[ {": [ + "vim::UnmatchedBackward", + { + "char": "{" + } + ], + "] )": [ + "vim::UnmatchedForward", + { + "char": ")" + } + ], + "[ (": [ + "vim::UnmatchedBackward", + { + "char": "(" + } + ], + "f": [ + "vim::PushFindForward", + { + "before": false + } + ], + "t": [ + "vim::PushFindForward", + { + "before": true + } + ], + "shift-f": [ + "vim::PushFindBackward", + { + "after": false + } + ], + "shift-t": [ + "vim::PushFindBackward", + { + "after": true + } + ], "m": "vim::PushMark", - "'": ["vim::PushJump", { "line": true }], - "`": ["vim::PushJump", { "line": false }], + "'": [ + "vim::PushJump", + { + "line": true + } + ], + "`": [ + "vim::PushJump", + { + "line": false + } + ], ";": "vim::RepeatFind", ",": "vim::RepeatFindReversed", "ctrl-o": "pane::GoBack", @@ -117,28 +202,93 @@ "g shift-n": "vim::SelectPreviousMatch", "g l": "vim::SelectNext", "g shift-l": "vim::SelectPrevious", - "g >": ["editor::SelectNext", { "replace_newest": true }], - "g <": ["editor::SelectPrevious", { "replace_newest": true }], + "g >": [ + "editor::SelectNext", + { + "replace_newest": true + } + ], + "g <": [ + "editor::SelectPrevious", + { + "replace_newest": true + } + ], "g a": "editor::SelectAllMatches", "g s": "outline::Toggle", "g shift-s": "project_symbols::Toggle", "g .": "editor::ToggleCodeActions", // zed specific "g shift-a": "editor::FindAllReferences", // zed specific "g space": "editor::OpenExcerpts", // zed specific - "g *": ["vim::MoveToNext", { "partial_word": true }], - "g #": ["vim::MoveToPrev", { "partial_word": true }], - "g j": ["vim::Down", { "display_lines": true }], - "g down": ["vim::Down", { "display_lines": true }], - "g k": ["vim::Up", { "display_lines": true }], - "g up": ["vim::Up", { "display_lines": true }], - "g $": ["vim::EndOfLine", { "display_lines": true }], - "g end": ["vim::EndOfLine", { "display_lines": true }], - "g 0": ["vim::StartOfLine", { "display_lines": true }], - "g home": ["vim::StartOfLine", { "display_lines": true }], - "g ^": ["vim::FirstNonWhitespace", { "display_lines": true }], + "g *": [ + "vim::MoveToNext", + { + "partial_word": true + } + ], + "g #": [ + "vim::MoveToPrev", + { + "partial_word": true + } + ], + "g j": [ + "vim::Down", + { + "display_lines": true + } + ], + "g down": [ + "vim::Down", + { + "display_lines": true + } + ], + "g k": [ + "vim::Up", + { + "display_lines": true + } + ], + "g up": [ + "vim::Up", + { + "display_lines": true + } + ], + "g $": [ + "vim::EndOfLine", + { + "display_lines": true + } + ], + "g end": [ + "vim::EndOfLine", + { + "display_lines": true + } + ], + "g 0": [ + "vim::StartOfLine", + { + "display_lines": true + } + ], + "g home": [ + "vim::StartOfLine", + { + "display_lines": true + } + ], + "g ^": [ + "vim::FirstNonWhitespace", + { + "display_lines": true + } + ], "g v": "vim::RestoreVisualSelection", "g ]": "editor::GoToDiagnostic", - "g [": "editor::GoToPrevDiagnostic", + "g [": "editor::GoToPreviousDiagnostic", "g i": "vim::InsertAtPrevious", "g ,": "vim::ChangeListNewer", "g ;": "vim::ChangeListOlder", @@ -149,13 +299,28 @@ "shift-q": "vim::ReplayLastRecording", "@": "vim::PushReplayRegister", // z commands - "z enter": ["workspace::SendKeystrokes", "z t ^"], - "z -": ["workspace::SendKeystrokes", "z b ^"], - "z ^": ["workspace::SendKeystrokes", "shift-h k z b ^"], - "z +": ["workspace::SendKeystrokes", "shift-l j z t ^"], + "z enter": [ + "workspace::SendKeystrokes", + "z t ^" + ], + "z -": [ + "workspace::SendKeystrokes", + "z b ^" + ], + "z ^": [ + "workspace::SendKeystrokes", + "shift-h k z b ^" + ], + "z +": [ + "workspace::SendKeystrokes", + "shift-l j z t ^" + ], "z t": "editor::ScrollCursorTop", "z z": "editor::ScrollCursorCenter", - "z .": ["workspace::SendKeystrokes", "z z ^"], + "z .": [ + "workspace::SendKeystrokes", + "z z ^" + ], "z b": "editor::ScrollCursorBottom", "z a": "editor::ToggleFold", "z shift-a": "editor::ToggleFoldRecursive", @@ -166,18 +331,55 @@ "z f": "editor::FoldSelectedRanges", "z shift-m": "editor::FoldAll", "z shift-r": "editor::UnfoldAll", - "shift-z shift-q": ["pane::CloseActiveItem", { "save_intent": "skip" }], - "shift-z shift-z": ["pane::CloseActiveItem", { "save_intent": "save_all" }], + "shift-z shift-q": [ + "pane::CloseActiveItem", + { + "save_intent": "skip" + } + ], + "shift-z shift-z": [ + "pane::CloseActiveItem", + { + "save_intent": "save_all" + } + ], // Count support - "1": ["vim::Number", 1], - "2": ["vim::Number", 2], - "3": ["vim::Number", 3], - "4": ["vim::Number", 4], - "5": ["vim::Number", 5], - "6": ["vim::Number", 6], - "7": ["vim::Number", 7], - "8": ["vim::Number", 8], - "9": ["vim::Number", 9], + "1": [ + "vim::Number", + 1 + ], + "2": [ + "vim::Number", + 2 + ], + "3": [ + "vim::Number", + 3 + ], + "4": [ + "vim::Number", + 4 + ], + "5": [ + "vim::Number", + 5 + ], + "6": [ + "vim::Number", + 6 + ], + "7": [ + "vim::Number", + 7 + ], + "8": [ + "vim::Number", + 8 + ], + "9": [ + "vim::Number", + 9 + ], "ctrl-w d": "editor::GoToDefinitionSplit", "ctrl-w g d": "editor::GoToDefinitionSplit", "ctrl-w shift-d": "editor::GoToTypeDefinitionSplit", @@ -214,7 +416,12 @@ "ctrl-a": "vim::Increment", "ctrl-x": "vim::Decrement", "p": "vim::Paste", - "shift-p": ["vim::Paste", { "before": true }], + "shift-p": [ + "vim::Paste", + { + "before": true + } + ], "u": "vim::Undo", "ctrl-r": "vim::Redo", "r": "vim::PushReplace", @@ -237,16 +444,19 @@ "[ x": "vim::SelectLargerSyntaxNode", "] x": "vim::SelectSmallerSyntaxNode", "] d": "editor::GoToDiagnostic", - "[ d": "editor::GoToPrevDiagnostic", + "[ d": "editor::GoToPreviousDiagnostic", "] c": "editor::GoToHunk", - "[ c": "editor::GoToPrevHunk", + "[ c": "editor::GoToPreviousHunk", "g c": "vim::PushToggleComments" } }, { "context": "VimControl && VimCount", "bindings": { - "0": ["vim::Number", 0], + "0": [ + "vim::Number", + 0 + ], ":": "vim::CountCommand" } }, @@ -265,18 +475,43 @@ "y": "vim::VisualYank", "shift-y": "vim::VisualYankLine", "p": "vim::Paste", - "shift-p": ["vim::Paste", { "preserve_clipboard": true }], + "shift-p": [ + "vim::Paste", + { + "preserve_clipboard": true + } + ], "c": "vim::Substitute", "s": "vim::Substitute", "shift-r": "vim::SubstituteLine", "shift-s": "vim::SubstituteLine", "~": "vim::ChangeCase", - "*": ["vim::MoveToNext", { "partial_word": true }], - "#": ["vim::MoveToPrev", { "partial_word": true }], + "*": [ + "vim::MoveToNext", + { + "partial_word": true + } + ], + "#": [ + "vim::MoveToPrev", + { + "partial_word": true + } + ], "ctrl-a": "vim::Increment", "ctrl-x": "vim::Decrement", - "g ctrl-a": ["vim::Increment", { "step": true }], - "g ctrl-x": ["vim::Decrement", { "step": true }], + "g ctrl-a": [ + "vim::Increment", + { + "step": true + } + ], + "g ctrl-x": [ + "vim::Decrement", + { + "step": true + } + ], "shift-i": "vim::InsertBefore", "shift-a": "vim::InsertAfter", "g shift-i": "vim::VisualInsertFirstNonWhiteSpace", @@ -291,9 +526,24 @@ "<": "vim::Outdent", "=": "vim::AutoIndent", "!": "vim::ShellCommand", - "i": ["vim::PushObject", { "around": false }], - "a": ["vim::PushObject", { "around": true }], - "g r": ["vim::Paste", { "preserve_clipboard": true }], + "i": [ + "vim::PushObject", + { + "around": false + } + ], + "a": [ + "vim::PushObject", + { + "around": true + } + ], + "g r": [ + "vim::Paste", + { + "preserve_clipboard": true + } + ], "g c": "vim::ToggleComments", "g q": "vim::Rewrap", "\"": "vim::PushRegister", @@ -318,11 +568,23 @@ "ctrl-u": "editor::DeleteToBeginningOfLine", "ctrl-t": "vim::Indent", "ctrl-d": "vim::Outdent", - "ctrl-k": ["vim::PushDigraph", {}], - "ctrl-v": ["vim::PushLiteral", {}], + "ctrl-k": [ + "vim::PushDigraph", + {} + ], + "ctrl-v": [ + "vim::PushLiteral", + {} + ], "ctrl-shift-v": "editor::Paste", // note: this is *very* similar to ctrl-v in vim, but ctrl-shift-v on linux is the typical shortcut for paste when ctrl-v is already in use. - "ctrl-q": ["vim::PushLiteral", {}], - "ctrl-shift-q": ["vim::PushLiteral", {}], + "ctrl-q": [ + "vim::PushLiteral", + {} + ], + "ctrl-shift-q": [ + "vim::PushLiteral", + {} + ], "ctrl-r": "vim::PushRegister", "insert": "vim::ToggleReplace", "ctrl-o": "vim::TemporaryNormal" @@ -337,14 +599,12 @@ "w": "vim::NextWordStart", "e": "vim::NextWordEnd", "b": "vim::PreviousWordStart", - "h": "vim::Left", "j": "vim::Down", "k": "vim::Up", "l": "vim::Right" } }, - { "context": "vim_mode == insert && !(showing_code_actions || showing_completions)", "bindings": { @@ -358,11 +618,23 @@ "ctrl-c": "vim::NormalBefore", "ctrl-[": "vim::NormalBefore", "escape": "vim::NormalBefore", - "ctrl-k": ["vim::PushDigraph", {}], - "ctrl-v": ["vim::PushLiteral", {}], + "ctrl-k": [ + "vim::PushDigraph", + {} + ], + "ctrl-v": [ + "vim::PushLiteral", + {} + ], "ctrl-shift-v": "editor::Paste", // note: this is *very* similar to ctrl-v in vim, but ctrl-shift-v on linux is the typical shortcut for paste when ctrl-v is already in use. - "ctrl-q": ["vim::PushLiteral", {}], - "ctrl-shift-q": ["vim::PushLiteral", {}], + "ctrl-q": [ + "vim::PushLiteral", + {} + ], + "ctrl-shift-q": [ + "vim::PushLiteral", + {} + ], "backspace": "vim::UndoReplace", "tab": "vim::Tab", "enter": "vim::Enter", @@ -377,9 +649,18 @@ "ctrl-c": "vim::ClearOperators", "ctrl-[": "vim::ClearOperators", "escape": "vim::ClearOperators", - "ctrl-k": ["vim::PushDigraph", {}], - "ctrl-v": ["vim::PushLiteral", {}], - "ctrl-q": ["vim::PushLiteral", {}] + "ctrl-k": [ + "vim::PushDigraph", + {} + ], + "ctrl-v": [ + "vim::PushLiteral", + {} + ], + "ctrl-q": [ + "vim::PushLiteral", + {} + ] } }, { @@ -401,7 +682,12 @@ "context": "vim_operator == a || vim_operator == i || vim_operator == cs", "bindings": { "w": "vim::Word", - "shift-w": ["vim::Word", { "ignore_punctuation": true }], + "shift-w": [ + "vim::Word", + { + "ignore_punctuation": true + } + ], // Subword TextObject // "w": "vim::Subword", // "shift-w": ["vim::Subword", { "ignore_punctuation": true }], @@ -427,7 +713,12 @@ ">": "vim::AngleBrackets", "a": "vim::Argument", "i": "vim::IndentObj", - "shift-i": ["vim::IndentObj", { "include_below": true }], + "shift-i": [ + "vim::IndentObj", + { + "include_below": true + } + ], "f": "vim::Method", "c": "vim::Class", "e": "vim::EntireFile" @@ -439,7 +730,10 @@ "c": "vim::CurrentLine", "x": "vim::Exchange", "d": "editor::Rename", // zed specific - "s": ["vim::PushChangeSurrounds", {}] + "s": [ + "vim::PushChangeSurrounds", + {} + ] } }, { @@ -485,7 +779,10 @@ "context": "vim_operator == y", "bindings": { "y": "vim::CurrentLine", - "s": ["vim::PushAddSurrounds", {}] + "s": [ + "vim::PushAddSurrounds", + {} + ] } }, { @@ -540,44 +837,266 @@ { "context": "vim_mode == literal", "bindings": { - "ctrl-@": ["vim::Literal", ["ctrl-@", "\u0000"]], - "ctrl-a": ["vim::Literal", ["ctrl-a", "\u0001"]], - "ctrl-b": ["vim::Literal", ["ctrl-b", "\u0002"]], - "ctrl-c": ["vim::Literal", ["ctrl-c", "\u0003"]], - "ctrl-d": ["vim::Literal", ["ctrl-d", "\u0004"]], - "ctrl-e": ["vim::Literal", ["ctrl-e", "\u0005"]], - "ctrl-f": ["vim::Literal", ["ctrl-f", "\u0006"]], - "ctrl-g": ["vim::Literal", ["ctrl-g", "\u0007"]], - "ctrl-h": ["vim::Literal", ["ctrl-h", "\u0008"]], - "ctrl-i": ["vim::Literal", ["ctrl-i", "\u0009"]], - "ctrl-j": ["vim::Literal", ["ctrl-j", "\u000A"]], - "ctrl-k": ["vim::Literal", ["ctrl-k", "\u000B"]], - "ctrl-l": ["vim::Literal", ["ctrl-l", "\u000C"]], - "ctrl-m": ["vim::Literal", ["ctrl-m", "\u000D"]], - "ctrl-n": ["vim::Literal", ["ctrl-n", "\u000E"]], - "ctrl-o": ["vim::Literal", ["ctrl-o", "\u000F"]], - "ctrl-p": ["vim::Literal", ["ctrl-p", "\u0010"]], - "ctrl-q": ["vim::Literal", ["ctrl-q", "\u0011"]], - "ctrl-r": ["vim::Literal", ["ctrl-r", "\u0012"]], - "ctrl-s": ["vim::Literal", ["ctrl-s", "\u0013"]], - "ctrl-t": ["vim::Literal", ["ctrl-t", "\u0014"]], - "ctrl-u": ["vim::Literal", ["ctrl-u", "\u0015"]], - "ctrl-v": ["vim::Literal", ["ctrl-v", "\u0016"]], - "ctrl-w": ["vim::Literal", ["ctrl-w", "\u0017"]], - "ctrl-x": ["vim::Literal", ["ctrl-x", "\u0018"]], - "ctrl-y": ["vim::Literal", ["ctrl-y", "\u0019"]], - "ctrl-z": ["vim::Literal", ["ctrl-z", "\u001A"]], - "ctrl-[": ["vim::Literal", ["ctrl-[", "\u001B"]], - "ctrl-\\": ["vim::Literal", ["ctrl-\\", "\u001C"]], - "ctrl-]": ["vim::Literal", ["ctrl-]", "\u001D"]], - "ctrl-^": ["vim::Literal", ["ctrl-^", "\u001E"]], - "ctrl-_": ["vim::Literal", ["ctrl-_", "\u001F"]], - "escape": ["vim::Literal", ["escape", "\u001B"]], - "enter": ["vim::Literal", ["enter", "\u000D"]], - "tab": ["vim::Literal", ["tab", "\u0009"]], + "ctrl-@": [ + "vim::Literal", + [ + "ctrl-@", + "\u0000" + ] + ], + "ctrl-a": [ + "vim::Literal", + [ + "ctrl-a", + "\u0001" + ] + ], + "ctrl-b": [ + "vim::Literal", + [ + "ctrl-b", + "\u0002" + ] + ], + "ctrl-c": [ + "vim::Literal", + [ + "ctrl-c", + "\u0003" + ] + ], + "ctrl-d": [ + "vim::Literal", + [ + "ctrl-d", + "\u0004" + ] + ], + "ctrl-e": [ + "vim::Literal", + [ + "ctrl-e", + "\u0005" + ] + ], + "ctrl-f": [ + "vim::Literal", + [ + "ctrl-f", + "\u0006" + ] + ], + "ctrl-g": [ + "vim::Literal", + [ + "ctrl-g", + "\u0007" + ] + ], + "ctrl-h": [ + "vim::Literal", + [ + "ctrl-h", + "\u0008" + ] + ], + "ctrl-i": [ + "vim::Literal", + [ + "ctrl-i", + "\u0009" + ] + ], + "ctrl-j": [ + "vim::Literal", + [ + "ctrl-j", + "\u000A" + ] + ], + "ctrl-k": [ + "vim::Literal", + [ + "ctrl-k", + "\u000B" + ] + ], + "ctrl-l": [ + "vim::Literal", + [ + "ctrl-l", + "\u000C" + ] + ], + "ctrl-m": [ + "vim::Literal", + [ + "ctrl-m", + "\u000D" + ] + ], + "ctrl-n": [ + "vim::Literal", + [ + "ctrl-n", + "\u000E" + ] + ], + "ctrl-o": [ + "vim::Literal", + [ + "ctrl-o", + "\u000F" + ] + ], + "ctrl-p": [ + "vim::Literal", + [ + "ctrl-p", + "\u0010" + ] + ], + "ctrl-q": [ + "vim::Literal", + [ + "ctrl-q", + "\u0011" + ] + ], + "ctrl-r": [ + "vim::Literal", + [ + "ctrl-r", + "\u0012" + ] + ], + "ctrl-s": [ + "vim::Literal", + [ + "ctrl-s", + "\u0013" + ] + ], + "ctrl-t": [ + "vim::Literal", + [ + "ctrl-t", + "\u0014" + ] + ], + "ctrl-u": [ + "vim::Literal", + [ + "ctrl-u", + "\u0015" + ] + ], + "ctrl-v": [ + "vim::Literal", + [ + "ctrl-v", + "\u0016" + ] + ], + "ctrl-w": [ + "vim::Literal", + [ + "ctrl-w", + "\u0017" + ] + ], + "ctrl-x": [ + "vim::Literal", + [ + "ctrl-x", + "\u0018" + ] + ], + "ctrl-y": [ + "vim::Literal", + [ + "ctrl-y", + "\u0019" + ] + ], + "ctrl-z": [ + "vim::Literal", + [ + "ctrl-z", + "\u001A" + ] + ], + "ctrl-[": [ + "vim::Literal", + [ + "ctrl-[", + "\u001B" + ] + ], + "ctrl-\\": [ + "vim::Literal", + [ + "ctrl-\\", + "\u001C" + ] + ], + "ctrl-]": [ + "vim::Literal", + [ + "ctrl-]", + "\u001D" + ] + ], + "ctrl-^": [ + "vim::Literal", + [ + "ctrl-^", + "\u001E" + ] + ], + "ctrl-_": [ + "vim::Literal", + [ + "ctrl-_", + "\u001F" + ] + ], + "escape": [ + "vim::Literal", + [ + "escape", + "\u001B" + ] + ], + "enter": [ + "vim::Literal", + [ + "enter", + "\u000D" + ] + ], + "tab": [ + "vim::Literal", + [ + "tab", + "\u0009" + ] + ], // zed extensions: - "backspace": ["vim::Literal", ["backspace", "\u0008"]], - "delete": ["vim::Literal", ["delete", "\u007F"]] + "backspace": [ + "vim::Literal", + [ + "backspace", + "\u0008" + ] + ], + "delete": [ + "vim::Literal", + [ + "delete", + "\u007F" + ] + ] } }, { @@ -664,7 +1183,7 @@ "escape": "project_panel::ToggleFocus", "h": "project_panel::CollapseSelectedEntry", "j": "menu::SelectNext", - "k": "menu::SelectPrev", + "k": "menu::SelectPrevious", "l": "project_panel::ExpandSelectedEntry", "o": "project_panel::OpenPermanent", "shift-d": "project_panel::Delete", @@ -690,7 +1209,7 @@ "context": "OutlinePanel && not_editing", "bindings": { "j": "menu::SelectNext", - "k": "menu::SelectPrev", + "k": "menu::SelectPrevious", "shift-g": "menu::SelectLast", "g g": "menu::SelectFirst" } @@ -699,7 +1218,7 @@ "context": "GitPanel && ChangesList", "use_key_equivalents": true, "bindings": { - "k": "menu::SelectPrev", + "k": "menu::SelectPrevious", "j": "menu::SelectNext", "g g": "menu::SelectFirst", "shift-g": "menu::SelectLast", @@ -727,4 +1246,4 @@ "alt-l": "editor::AcceptEditPrediction" } } -] +] \ No newline at end of file diff --git a/crates/assistant2/src/thread_history.rs b/crates/assistant2/src/thread_history.rs index 89023175e426b6905015327e71a7432f76bbf28d..dca2b09b8b85c3b62582c36a5d59672f1dbc8bdc 100644 --- a/crates/assistant2/src/thread_history.rs +++ b/crates/assistant2/src/thread_history.rs @@ -33,9 +33,9 @@ impl ThreadHistory { } } - pub fn select_prev( + pub fn select_previous( &mut self, - _: &menu::SelectPrev, + _: &menu::SelectPrevious, window: &mut Window, cx: &mut Context, ) { @@ -160,7 +160,7 @@ impl Render for ThreadHistory { .overflow_y_scroll() .size_full() .p_1() - .on_action(cx.listener(Self::select_prev)) + .on_action(cx.listener(Self::select_previous)) .on_action(cx.listener(Self::select_next)) .on_action(cx.listener(Self::select_first)) .on_action(cx.listener(Self::select_last)) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 0e9da50f3192a896d9d3752257d797785a6b9d9b..cbbb6e0e80486013f19f834b321c98a895b44029 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -17,7 +17,7 @@ use gpui::{ ListState, MouseDownEvent, ParentElement, Pixels, Point, PromptLevel, Render, SharedString, Styled, Subscription, Task, TextStyle, WeakEntity, Window, }; -use menu::{Cancel, Confirm, SecondaryConfirm, SelectNext, SelectPrev}; +use menu::{Cancel, Confirm, SecondaryConfirm, SelectNext, SelectPrevious}; use project::{Fs, Project}; use rpc::{ proto::{self, ChannelVisibility, PeerId}, @@ -1430,7 +1430,7 @@ impl CollabPanel { cx.notify(); } - fn select_prev(&mut self, _: &SelectPrev, _: &mut Window, cx: &mut Context) { + fn select_previous(&mut self, _: &SelectPrevious, _: &mut Window, cx: &mut Context) { let ix = self.selection.take().unwrap_or(0); if ix > 0 { self.selection = Some(ix - 1); @@ -2878,7 +2878,7 @@ impl Render for CollabPanel { .key_context("CollabPanel") .on_action(cx.listener(CollabPanel::cancel)) .on_action(cx.listener(CollabPanel::select_next)) - .on_action(cx.listener(CollabPanel::select_prev)) + .on_action(cx.listener(CollabPanel::select_previous)) .on_action(cx.listener(CollabPanel::confirm)) .on_action(cx.listener(CollabPanel::insert_space)) .on_action(cx.listener(CollabPanel::remove_selected_channel)) diff --git a/crates/editor/src/actions.rs b/crates/editor/src/actions.rs index f01a869171ec620ea50566a31baf9a7a2f324688..e788c7d6402021d19e7f9ed5084c7d35ca984241 100644 --- a/crates/editor/src/actions.rs +++ b/crates/editor/src/actions.rs @@ -257,7 +257,7 @@ gpui::actions!( ContextMenuFirst, ContextMenuLast, ContextMenuNext, - ContextMenuPrev, + ContextMenuPrevious, ConvertToKebabCase, ConvertToLowerCamelCase, ConvertToLowerCase, @@ -303,8 +303,8 @@ gpui::actions!( GoToHunk, GoToImplementation, GoToImplementationSplit, - GoToPrevDiagnostic, - GoToPrevHunk, + GoToPreviousDiagnostic, + GoToPreviousHunk, GoToTypeDefinition, GoToTypeDefinitionSplit, HalfPageDown, @@ -398,7 +398,7 @@ gpui::actions!( SplitSelectionIntoLines, SwitchSourceHeader, Tab, - TabPrev, + Backtab, ToggleAutoSignatureHelp, ToggleGitBlame, ToggleGitBlameInline, diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 645cb9cf09af23d24890b7ca546c9742849e81f3..8a320fd0c8620f7df9099b524a6ee254901b949c 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -7165,7 +7165,7 @@ impl Editor { }); } - pub fn tab_prev(&mut self, _: &TabPrev, window: &mut Window, cx: &mut Context) { + pub fn backtab(&mut self, _: &Backtab, window: &mut Window, cx: &mut Context) { if self.move_to_prev_snippet_tabstop(window, cx) { return; } @@ -9201,7 +9201,7 @@ impl Editor { pub fn context_menu_prev( &mut self, - _: &ContextMenuPrev, + _: &ContextMenuPrevious, _window: &mut Window, cx: &mut Context, ) { @@ -11228,7 +11228,7 @@ impl Editor { fn go_to_prev_diagnostic( &mut self, - _: &GoToPrevDiagnostic, + _: &GoToPreviousDiagnostic, window: &mut Window, cx: &mut Context, ) { @@ -11411,7 +11411,12 @@ impl Editor { hunk } - fn go_to_prev_hunk(&mut self, _: &GoToPrevHunk, window: &mut Window, cx: &mut Context) { + fn go_to_prev_hunk( + &mut self, + _: &GoToPreviousHunk, + window: &mut Window, + cx: &mut Context, + ) { let snapshot = self.snapshot(window, cx); let selection = self.selections.newest::(cx); self.go_to_hunk_before_position(&snapshot, selection.head(), window, cx); diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index 36b9108bc45d13fbc9bbd241b776ba900d0407d0..91f6d256d7efa59eca177d30ce2a1672e7f73550 100644 --- a/crates/editor/src/editor_tests.rs +++ b/crates/editor/src/editor_tests.rs @@ -2854,7 +2854,7 @@ async fn test_indent_outdent(cx: &mut TestAppContext) { four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" «oneˇ» «twoˇ» three @@ -2874,7 +2874,7 @@ async fn test_indent_outdent(cx: &mut TestAppContext) { ˇ» four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two t«hree @@ -2899,7 +2899,7 @@ async fn test_indent_outdent(cx: &mut TestAppContext) { ˇ three four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two ˇthree @@ -2933,13 +2933,13 @@ async fn test_indent_outdent_with_hard_tabs(cx: &mut TestAppContext) { three four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" \t«oneˇ» «twoˇ» three four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" «oneˇ» «twoˇ» three @@ -2964,13 +2964,13 @@ async fn test_indent_outdent_with_hard_tabs(cx: &mut TestAppContext) { \t\tt«hree ˇ»four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two \tt«hree ˇ»four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two t«hree @@ -2983,7 +2983,7 @@ async fn test_indent_outdent_with_hard_tabs(cx: &mut TestAppContext) { ˇthree four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two ˇthree @@ -2995,7 +2995,7 @@ async fn test_indent_outdent_with_hard_tabs(cx: &mut TestAppContext) { \tˇthree four "}); - cx.update_editor(|e, window, cx| e.tab_prev(&TabPrev, window, cx)); + cx.update_editor(|e, window, cx| e.backtab(&Backtab, window, cx)); cx.assert_editor_state(indoc! {" one two ˇthree @@ -3100,7 +3100,7 @@ fn test_indent_outdent_with_excerpts(cx: &mut TestAppContext) { "}, cx, ); - editor.tab_prev(&TabPrev, window, cx); + editor.backtab(&Backtab, window, cx); assert_text_with_selections( &mut editor, indoc! {" @@ -10764,7 +10764,7 @@ async fn go_to_prev_overlapping_diagnostic(executor: BackgroundExecutor, cx: &mu executor.run_until_parked(); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" @@ -10773,7 +10773,7 @@ async fn go_to_prev_overlapping_diagnostic(executor: BackgroundExecutor, cx: &mu "}); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" @@ -10782,7 +10782,7 @@ async fn go_to_prev_overlapping_diagnostic(executor: BackgroundExecutor, cx: &mu "}); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" @@ -10791,7 +10791,7 @@ async fn go_to_prev_overlapping_diagnostic(executor: BackgroundExecutor, cx: &mu "}); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" @@ -10871,7 +10871,7 @@ async fn cycle_through_same_place_diagnostics( // Fourth diagnostic cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" fn func(abc def: i32) -> ˇu32 { @@ -10880,7 +10880,7 @@ async fn cycle_through_same_place_diagnostics( // Third diagnostic cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" fn func(abc ˇdef: i32) -> u32 { @@ -10889,7 +10889,7 @@ async fn cycle_through_same_place_diagnostics( // Second diagnostic, same place cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" fn func(abc ˇdef: i32) -> u32 { @@ -10898,7 +10898,7 @@ async fn cycle_through_same_place_diagnostics( // First diagnostic cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" fn func(abcˇ def: i32) -> u32 { @@ -10907,7 +10907,7 @@ async fn cycle_through_same_place_diagnostics( // Wrapped over, fourth diagnostic cx.update_editor(|editor, window, cx| { - editor.go_to_prev_diagnostic(&GoToPrevDiagnostic, window, cx); + editor.go_to_prev_diagnostic(&GoToPreviousDiagnostic, window, cx); }); cx.assert_editor_state(indoc! {" fn func(abc def: i32) -> ˇu32 { @@ -11073,7 +11073,7 @@ async fn test_go_to_hunk(executor: BackgroundExecutor, cx: &mut TestAppContext) cx.update_editor(|editor, window, cx| { //Wrap around the top of the buffer for _ in 0..2 { - editor.go_to_prev_hunk(&GoToPrevHunk, window, cx); + editor.go_to_prev_hunk(&GoToPreviousHunk, window, cx); } }); @@ -11093,7 +11093,7 @@ async fn test_go_to_hunk(executor: BackgroundExecutor, cx: &mut TestAppContext) ); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_hunk(&GoToPrevHunk, window, cx); + editor.go_to_prev_hunk(&GoToPreviousHunk, window, cx); }); cx.assert_editor_state( @@ -11112,7 +11112,7 @@ async fn test_go_to_hunk(executor: BackgroundExecutor, cx: &mut TestAppContext) ); cx.update_editor(|editor, window, cx| { - editor.go_to_prev_hunk(&GoToPrevHunk, window, cx); + editor.go_to_prev_hunk(&GoToPreviousHunk, window, cx); }); cx.assert_editor_state( @@ -11132,7 +11132,7 @@ async fn test_go_to_hunk(executor: BackgroundExecutor, cx: &mut TestAppContext) cx.update_editor(|editor, window, cx| { for _ in 0..2 { - editor.go_to_prev_hunk(&GoToPrevHunk, window, cx); + editor.go_to_prev_hunk(&GoToPreviousHunk, window, cx); } }); @@ -11867,7 +11867,7 @@ async fn test_completions_resolve_happens_once(cx: &mut TestAppContext) { }); cx.run_until_parked(); cx.update_editor(|editor, window, cx| { - editor.context_menu_prev(&ContextMenuPrev, window, cx); + editor.context_menu_prev(&ContextMenuPrevious, window, cx); }); cx.run_until_parked(); cx.update_editor(|editor, window, cx| { @@ -12057,7 +12057,7 @@ async fn test_completions_default_resolve_data_handling(cx: &mut TestAppContext) resolved_items.lock().clear(); cx.update_editor(|editor, window, cx| { - editor.context_menu_prev(&ContextMenuPrev, window, cx); + editor.context_menu_prev(&ContextMenuPrevious, window, cx); }); cx.run_until_parked(); // Completions that have already been resolved are skipped. diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 3a80b45297e0770dcfdccc90b74dfa415d20b9a7..9cca2df40180bf953a1020d70098432a6d36b2e9 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -18,7 +18,7 @@ use crate::{ BlockId, ChunkReplacement, CursorShape, CustomBlockId, DisplayDiffHunk, DisplayPoint, DisplayRow, DocumentHighlightRead, DocumentHighlightWrite, EditDisplayMode, Editor, EditorMode, EditorSettings, EditorSnapshot, EditorStyle, ExpandExcerpts, FocusedBlock, GoToHunk, - GoToPrevHunk, GutterDimensions, HalfPageDown, HalfPageUp, HandleInput, HoveredCursor, + GoToPreviousHunk, GutterDimensions, HalfPageDown, HalfPageUp, HandleInput, HoveredCursor, InlineCompletion, JumpData, LineDown, LineUp, OpenExcerpts, PageDown, PageUp, Point, RowExt, RowRangeExt, SelectPhase, SelectedTextHighlight, Selection, SoftWrap, StickyHeaderExcerpt, ToPoint, ToggleFold, COLUMNAR_SELECTION_MODIFIERS, CURSORS_VISIBLE_FOR, FILE_HEADER_HEIGHT, @@ -193,7 +193,7 @@ impl EditorElement { register_action(editor, window, Editor::backspace); register_action(editor, window, Editor::delete); register_action(editor, window, Editor::tab); - register_action(editor, window, Editor::tab_prev); + register_action(editor, window, Editor::backtab); register_action(editor, window, Editor::indent); register_action(editor, window, Editor::outdent); register_action(editor, window, Editor::autoindent); @@ -8830,7 +8830,7 @@ fn diff_hunk_controls( move |window, cx| { Tooltip::for_action_in( "Previous Hunk", - &GoToPrevHunk, + &GoToPreviousHunk, &focus_handle, window, cx, diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index 7d537e5cb7f27d1b44cd7a71654b7efc6f47c358..28a3372d4e69cf6972724cad9979b9c83ca954da 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -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) { + fn handle_select_prev( + &mut self, + _: &SelectPrevious, + window: &mut Window, + cx: &mut Context, + ) { 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) { diff --git a/crates/file_finder/src/file_finder_tests.rs b/crates/file_finder/src/file_finder_tests.rs index 1dd7815956d8aa68ffe70642aaa6e07b63aaa5c5..13c226ded209b5ed949538f85665ad04aee2d573 100644 --- a/crates/file_finder/src/file_finder_tests.rs +++ b/crates/file_finder/src/file_finder_tests.rs @@ -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::(cx).unwrap(); diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 52172c701e5b37ca44b8b90187c291b906d32e99..0f613659d612215d8786bb0907058f0635ea3b2f 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -17,7 +17,7 @@ use git::{Push, 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, PanelHeader}; use project::{ @@ -557,7 +557,12 @@ impl GitPanel { } } - fn select_prev(&mut self, _: &SelectPrev, _window: &mut Window, cx: &mut Context) { + fn select_previous( + &mut self, + _: &SelectPrevious, + _window: &mut Window, + cx: &mut Context, + ) { let item_count = self.entries.len(); if item_count == 0 { return; @@ -2669,7 +2674,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)) diff --git a/crates/git_ui/src/project_diff.rs b/crates/git_ui/src/project_diff.rs index e9cb953651ce4bf300f837eec4077ffc7bd21c93..9f4a07809b780429b268e6115be074c93f41ec66 100644 --- a/crates/git_ui/src/project_diff.rs +++ b/crates/git_ui/src/project_diff.rs @@ -5,7 +5,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, }; @@ -846,12 +846,12 @@ impl Render for ProjectDiffToolbar { .shape(ui::IconButtonShape::Square) .tooltip(Tooltip::for_action_title_in( "Go to previous hunk", - &GoToPrevHunk, + &GoToPreviousHunk, &focus_handle, )) .disabled(!button_states.prev_next) .on_click(cx.listener(|this, _, window, cx| { - this.dispatch_action(&GoToPrevHunk, window, cx) + this.dispatch_action(&GoToPreviousHunk, window, cx) })), ) .child( diff --git a/crates/menu/src/menu.rs b/crates/menu/src/menu.rs index 3c5dc2521f7275f163ec42b4b55b2f472a5f5480..7c8cc7abb08ae58516a6662b1b6b09e2465bb441 100644 --- a/crates/menu/src/menu.rs +++ b/crates/menu/src/menu.rs @@ -15,7 +15,7 @@ actions!( Cancel, Confirm, SecondaryConfirm, - SelectPrev, + SelectPrevious, SelectNext, SelectFirst, SelectLast, diff --git a/crates/migrator/src/migrator.rs b/crates/migrator/src/migrator.rs index 7ab45a1c771987c4bb632207d46de8eafda6edb5..5be667e3dbddf5996cb484cde5b0f0064fee0521 100644 --- a/crates/migrator/src/migrator.rs +++ b/crates/migrator/src/migrator.rs @@ -92,6 +92,10 @@ const KEYMAP_MIGRATION_TRANSFORMATION_PATTERNS: MigrationPatterns = &[ ), (ACTION_STRING_PATTERN, rename_string_action), (CONTEXT_PREDICATE_PATTERN, rename_context_key), + ( + ACTION_STRING_OF_ARRAY_PATTERN, + replace_first_string_of_array, + ), ]; static KEYMAP_MIGRATION_TRANSFORMATION_QUERY: LazyLock = LazyLock::new(|| { @@ -265,6 +269,51 @@ static TRANSFORM_ARRAY: LazyLock> = LazyLock::new(|| ]) }); +const ACTION_STRING_OF_ARRAY_PATTERN: &str = r#"(document + (array + (object + (pair + key: (string (string_content) @name) + value: ( + (object + (pair + key: (string) + value: ((array + . (string (string_content) @action_name) + ) + ) + ) + ) + ) + ) + ) + ) + (#eq? @name "bindings") +)"#; + +// ["editor::GoToPrevHunk", { "center_cursor": true }] -> ["editor::GoToPreviousHunk", { "center_cursor": true }] +fn replace_first_string_of_array( + contents: &str, + mat: &QueryMatch, + query: &Query, +) -> Option<(Range, String)> { + let action_name_ix = query.capture_index_for_name("action_name")?; + let action_name = contents.get( + mat.nodes_for_capture_index(action_name_ix) + .next()? + .byte_range(), + )?; + let replacement = STRING_OF_ARRAY_REPLACE.get(action_name)?; + let range_to_replace = mat + .nodes_for_capture_index(action_name_ix) + .next()? + .byte_range(); + Some((range_to_replace, replacement.to_string())) +} + +static STRING_OF_ARRAY_REPLACE: LazyLock> = + LazyLock::new(|| HashMap::from_iter([("editor::GoToPrevHunk", "editor::GoToPreviousHunk")])); + const ACTION_ARGUMENT_OBJECT_PATTERN: &str = r#"(document (array (object @@ -424,20 +473,29 @@ static STRING_REPLACE: LazyLock> = LazyLock::new(|| { "editor::ToggleInlineCompletions", "editor::ToggleEditPrediction", ), + ( + "editor::GoToPrevDiagnostic", + "editor::GoToPreviousDiagnostic", + ), + ("editor::ContextMenuPrev", "editor::ContextMenuPrevious"), + ("search::SelectPrevMatch", "search::SelectPreviousMatch"), + ("file_finder::SelectPrev", "file_finder::SelectPrevious"), + ("menu::SelectPrev", "menu::SelectPrevious"), + ("editor::TabPrev", "editor::Backtab"), ]) }); -const CONTEXT_PREDICATE_PATTERN: &str = r#" -(array - (object - (pair - key: (string (string_content) @name) - value: (string (string_content) @context_predicate) +const CONTEXT_PREDICATE_PATTERN: &str = r#"(document + (array + (object + (pair + key: (string (string_content) @name) + value: (string (string_content) @context_predicate) + ) ) ) -) -(#eq? @name "context") -"#; + (#eq? @name "context") +)"#; fn rename_context_key( contents: &str, @@ -865,6 +923,36 @@ mod tests { ) } + #[test] + fn test_string_of_array_replace() { + assert_migrate_keymap( + r#" + [ + { + "bindings": { + "ctrl-p": ["editor::GoToPrevHunk", { "center_cursor": true }], + "ctrl-q": ["editor::GoToPrevHunk"], + "ctrl-q": "editor::GoToPrevHunk", // should remain same + } + } + ] + "#, + Some( + r#" + [ + { + "bindings": { + "ctrl-p": ["editor::GoToPreviousHunk", { "center_cursor": true }], + "ctrl-q": ["editor::GoToPreviousHunk"], + "ctrl-q": "editor::GoToPrevHunk", // should remain same + } + } + ] + "#, + ), + ) + } + #[test] fn test_action_argument_snake_case() { // First performs transformations, then replacements diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs index 3d119f9b887bd24294d23e4be94f3688f726a317..73fad1b8f083ccc5a659494aa2d0650069abc2d4 100644 --- a/crates/outline/src/outline.rs +++ b/crates/outline/src/outline.rs @@ -448,7 +448,7 @@ mod tests { ); assert_single_caret_at_row(&editor, 0, cx); - cx.dispatch_action(menu::SelectPrev); + cx.dispatch_action(menu::SelectPrevious); ensure_outline_view_contents(&outline_view, cx); assert_eq!( highlighted_display_rows(&editor, cx), diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index eaa05b68badc14a8240378de09a0ce0ab73c0280..58cf5db5ed0fd47916823d6689ec206001abd0ef 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -37,7 +37,7 @@ use gpui::{ }; use itertools::Itertools; use language::{BufferId, BufferSnapshot, OffsetRangeExt, OutlineItem}; -use menu::{Cancel, SelectFirst, SelectLast, SelectNext, SelectPrev}; +use menu::{Cancel, SelectFirst, SelectLast, SelectNext, SelectPrevious}; use outline_panel_settings::{OutlinePanelDockPosition, OutlinePanelSettings, ShowIndentGuides}; use project::{File, Fs, Project, ProjectItem}; @@ -1148,7 +1148,7 @@ impl OutlinePanel { } } - fn select_prev(&mut self, _: &SelectPrev, window: &mut Window, cx: &mut Context) { + fn select_previous(&mut self, _: &SelectPrevious, window: &mut Window, cx: &mut Context) { if let Some(entry_to_select) = self.selected_entry().and_then(|selected_entry| { self.cached_entries .iter() @@ -4911,7 +4911,7 @@ impl Render for OutlinePanel { .on_action(cx.listener(Self::open)) .on_action(cx.listener(Self::cancel)) .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_first)) .on_action(cx.listener(Self::select_last)) .on_action(cx.listener(Self::select_parent)) @@ -5851,7 +5851,7 @@ mod tests { }); outline_panel.update_in(cx, |outline_panel, window, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); outline_panel.open(&Open, window, cx); }); cx.executor() @@ -6138,7 +6138,7 @@ outline: struct OutlineEntryExcerpt <==== selected cx.update(|window, cx| { outline_panel.update(cx, |outline_panel, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); }); }); cx.executor() @@ -6165,7 +6165,7 @@ outline: struct OutlineEntryExcerpt cx.update(|window, cx| { outline_panel.update(cx, |outline_panel, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); }); }); cx.executor() @@ -6192,7 +6192,7 @@ outline: struct OutlineEntryExcerpt cx.update(|window, cx| { outline_panel.update(cx, |outline_panel, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); }); }); cx.executor() @@ -6219,7 +6219,7 @@ outline: struct OutlineEntryExcerpt cx.update(|window, cx| { outline_panel.update(cx, |outline_panel, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); }); }); cx.executor() @@ -6246,7 +6246,7 @@ outline: struct OutlineEntryExcerpt <==== selected cx.update(|window, cx| { outline_panel.update(cx, |outline_panel, cx| { - outline_panel.select_prev(&SelectPrev, window, cx); + outline_panel.select_previous(&SelectPrevious, window, cx); }); }); cx.executor() diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs index 0a4bf14c564585853e6b55c41b2d080929f225e4..469513a2ca0fd143d38bd16aa441929a0b189228 100644 --- a/crates/picker/src/picker.rs +++ b/crates/picker/src/picker.rs @@ -391,7 +391,12 @@ impl Picker { } } - fn select_prev(&mut self, _: &menu::SelectPrev, window: &mut Window, cx: &mut Context) { + fn select_previous( + &mut self, + _: &menu::SelectPrevious, + window: &mut Window, + cx: &mut Context, + ) { let count = self.delegate.match_count(); if count > 0 { let index = self.delegate.selected_index(); @@ -786,7 +791,7 @@ impl Render for Picker { // We should revisit how the `Picker` is styled to make it more composable. .when(self.is_modal, |this| this.elevation_3(cx)) .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_first)) .on_action(cx.listener(Self::select_last)) .on_action(cx.listener(Self::cancel)) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index de5a68ac3fe270932daa05a70cc2e7ab5bd8487f..6de8c72eee1b7fabe48b365973acd6d6b0e85ac9 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -26,7 +26,7 @@ use gpui::{ }; use indexmap::IndexMap; use language::DiagnosticSeverity; -use menu::{Confirm, SelectFirst, SelectLast, SelectNext, SelectPrev}; +use menu::{Confirm, SelectFirst, SelectLast, SelectNext, SelectPrevious}; use project::{ relativize_path, Entry, EntryKind, Fs, Project, ProjectEntryId, ProjectPath, Worktree, WorktreeId, @@ -1027,7 +1027,7 @@ impl ProjectPanel { }); } - fn select_prev(&mut self, _: &SelectPrev, window: &mut Window, cx: &mut Context) { + fn select_previous(&mut self, _: &SelectPrevious, window: &mut Window, cx: &mut Context) { if let Some(edit_state) = &self.edit_state { if edit_state.processing_filename.is_none() { self.filename_editor.update(cx, |editor, cx| { @@ -4433,7 +4433,7 @@ impl Render for ProjectPanel { })) .key_context(self.dispatch_context(window, cx)) .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_first)) .on_action(cx.listener(Self::select_last)) .on_action(cx.listener(Self::select_parent)) @@ -7521,7 +7521,7 @@ mod tests { ); cx.update(|window, cx| { panel.update(cx, |this, cx| { - this.select_prev(&Default::default(), window, cx); + this.select_previous(&Default::default(), window, cx); }) }); assert_eq!( @@ -7578,7 +7578,7 @@ mod tests { // ESC clears out all marks cx.update(|window, cx| { panel.update(cx, |this, cx| { - this.select_prev(&SelectPrev, window, cx); + this.select_previous(&SelectPrevious, window, cx); this.select_next(&SelectNext, window, cx); }) }); @@ -7596,8 +7596,8 @@ mod tests { cx.update(|window, cx| { panel.update(cx, |this, cx| { this.cut(&Cut, window, cx); - this.select_prev(&SelectPrev, window, cx); - this.select_prev(&SelectPrev, window, cx); + this.select_previous(&SelectPrevious, window, cx); + this.select_previous(&SelectPrevious, window, cx); this.paste(&Paste, window, cx); // this.expand_selected_entry(&ExpandSelectedEntry, cx); diff --git a/crates/repl/src/notebook/notebook_ui.rs b/crates/repl/src/notebook/notebook_ui.rs index 9b40b973d8d058fb09c334a7b1dcb32fc235246b..eaa7cb97f185b070d89db051c9ab702348d90e4f 100644 --- a/crates/repl/src/notebook/notebook_ui.rs +++ b/crates/repl/src/notebook/notebook_ui.rs @@ -245,7 +245,7 @@ impl NotebookEditor { pub fn select_previous( &mut self, - _: &menu::SelectPrev, + _: &menu::SelectPrevious, window: &mut Window, cx: &mut Context, ) { diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs index 62b65b3bd484f3d4789288658377388b1195491d..93442a63125ba0844c4050db248a6feda5d15dcb 100644 --- a/crates/search/src/buffer_search.rs +++ b/crates/search/src/buffer_search.rs @@ -2,14 +2,14 @@ mod registrar; use crate::{ search_bar::render_nav_button, FocusSearch, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll, - ReplaceNext, SearchOptions, SelectAllMatches, SelectNextMatch, SelectPrevMatch, + ReplaceNext, SearchOptions, SelectAllMatches, SelectNextMatch, SelectPreviousMatch, ToggleCaseSensitive, ToggleRegex, ToggleReplace, ToggleSelection, ToggleWholeWord, }; use any_vec::AnyVec; use anyhow::Context as _; use collections::HashMap; use editor::{ - actions::{Tab, TabPrev}, + actions::{Backtab, Tab}, DisplayPoint, Editor, EditorElement, EditorSettings, EditorStyle, }; use futures::channel::oneshot; @@ -380,7 +380,7 @@ impl Render for BufferSearchBar { ui::IconName::ChevronLeft, self.active_match_index.is_some(), "Select Previous Match", - &SelectPrevMatch, + &SelectPreviousMatch, focus_handle.clone(), )) .child(render_nav_button( @@ -477,7 +477,7 @@ impl Render for BufferSearchBar { .track_scroll(&self.scroll_handle) .key_context(key_context) .capture_action(cx.listener(Self::tab)) - .capture_action(cx.listener(Self::tab_prev)) + .capture_action(cx.listener(Self::backtab)) .on_action(cx.listener(Self::previous_history_query)) .on_action(cx.listener(Self::next_history_query)) .on_action(cx.listener(Self::dismiss)) @@ -625,13 +625,15 @@ impl BufferSearchBar { this.select_next_match(action, window, cx); } })); - registrar.register_handler(WithResults(|this, action: &SelectPrevMatch, window, cx| { - if this.supported_options(cx).find_in_results { - cx.propagate(); - } else { - this.select_prev_match(action, window, cx); - } - })); + registrar.register_handler(WithResults( + |this, action: &SelectPreviousMatch, window, cx| { + if this.supported_options(cx).find_in_results { + cx.propagate(); + } else { + this.select_prev_match(action, window, cx); + } + }, + )); registrar.register_handler(WithResults( |this, action: &SelectAllMatches, window, cx| { if this.supported_options(cx).find_in_results { @@ -992,7 +994,7 @@ impl BufferSearchBar { fn select_prev_match( &mut self, - _: &SelectPrevMatch, + _: &SelectPreviousMatch, window: &mut Window, cx: &mut Context, ) { @@ -1329,7 +1331,7 @@ impl BufferSearchBar { cx.stop_propagation(); } - fn tab_prev(&mut self, _: &TabPrev, window: &mut Window, cx: &mut Context) { + fn backtab(&mut self, _: &Backtab, window: &mut Window, cx: &mut Context) { // Search -> Replace -> Search let focus_handle = if self.replace_enabled && self.query_editor_focused { self.replacement_editor.focus_handle(cx) @@ -1695,7 +1697,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(3), 56)..DisplayPoint::new(DisplayRow(3), 58)] @@ -1706,7 +1708,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(3), 11)..DisplayPoint::new(DisplayRow(3), 13)] @@ -1717,7 +1719,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(0), 41)..DisplayPoint::new(DisplayRow(0), 43)] @@ -1738,7 +1740,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { assert_eq!(search_bar.active_match_index, Some(1)); - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(0), 41)..DisplayPoint::new(DisplayRow(0), 43)] @@ -1780,7 +1782,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { assert_eq!(search_bar.active_match_index, Some(2)); - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(3), 56)..DisplayPoint::new(DisplayRow(3), 58)] @@ -1822,7 +1824,7 @@ mod tests { }); search_bar.update_in(cx, |search_bar, window, cx| { assert_eq!(search_bar.active_match_index, Some(0)); - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); assert_eq!( editor.update(cx, |editor, cx| editor.selections.display_ranges(cx)), [DisplayPoint::new(DisplayRow(3), 56)..DisplayPoint::new(DisplayRow(3), 58)] @@ -2035,7 +2037,7 @@ mod tests { ); }); search_bar.update(cx, |search_bar, cx| { - search_bar.select_prev_match(&SelectPrevMatch, window, cx); + search_bar.select_prev_match(&SelectPreviousMatch, window, cx); }); }) .unwrap(); @@ -2043,7 +2045,7 @@ mod tests { .update(cx, |_, window, cx| { assert!( editor.read(cx).is_focused(window), - "Should still have editor focused after SelectPrevMatch" + "Should still have editor focused after SelectPreviousMatch" ); search_bar.update(cx, |search_bar, cx| { diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index 658a2673737debb4ef6ff59144e98ee4e246140a..e9f26e19e4c485d6449caa45ceeedab86d3a090e 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -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) }, ); @@ -1439,9 +1439,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, ) { @@ -1696,7 +1696,7 @@ impl ProjectSearchBar { fn select_prev_match( &mut self, - _: &SelectPrevMatch, + _: &SelectPreviousMatch, window: &mut Window, cx: &mut Context, ) { @@ -1895,7 +1895,7 @@ impl Render for ProjectSearchBar { move |window, cx| { Tooltip::for_action_in( "Go To Previous Match", - &SelectPrevMatch, + &SelectPreviousMatch, &focus_handle, window, cx, @@ -2094,7 +2094,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))) diff --git a/crates/search/src/search.rs b/crates/search/src/search.rs index 28b61b5605e46921ddc8ce5eba9934b72c4f21c4..4bfea34c788cdab4462b6c9c818735ebc6d3f685 100644 --- a/crates/search/src/search.rs +++ b/crates/search/src/search.rs @@ -30,7 +30,7 @@ actions!( ToggleReplace, ToggleSelection, SelectNextMatch, - SelectPrevMatch, + SelectPreviousMatch, SelectAllMatches, NextHistoryQuery, PreviousHistoryQuery, diff --git a/crates/settings/src/keymap_file.rs b/crates/settings/src/keymap_file.rs index 10980bba426e4d26d2d1ac55b2d5cbae971f83fa..7b953b8bae8af94d832fedfb0b05d428f286fede 100644 --- a/crates/settings/src/keymap_file.rs +++ b/crates/settings/src/keymap_file.rs @@ -620,7 +620,7 @@ mod tests { // Standard macOS bindings { \"bindings\": { - \"up\": \"menu::SelectPrev\", + \"up\": \"menu::SelectPrevious\", }, }, ] diff --git a/crates/storybook/src/stories/picker.rs b/crates/storybook/src/stories/picker.rs index 6a49042f906c32273ad8a4a3847060a1f0830a54..a946bfed7c673cbf2f8576b5fe827825cfff5f9d 100644 --- a/crates/storybook/src/stories/picker.rs +++ b/crates/storybook/src/stories/picker.rs @@ -114,10 +114,10 @@ impl PickerStory { pub fn new(window: &mut Window, cx: &mut App) -> Entity { cx.new(|cx| { cx.bind_keys([ - KeyBinding::new("up", menu::SelectPrev, Some("picker")), + KeyBinding::new("up", menu::SelectPrevious, Some("picker")), KeyBinding::new("pageup", menu::SelectFirst, Some("picker")), KeyBinding::new("shift-pageup", menu::SelectFirst, Some("picker")), - KeyBinding::new("ctrl-p", menu::SelectPrev, Some("picker")), + KeyBinding::new("ctrl-p", menu::SelectPrevious, Some("picker")), KeyBinding::new("down", menu::SelectNext, Some("picker")), KeyBinding::new("pagedown", menu::SelectLast, Some("picker")), KeyBinding::new("shift-pagedown", menu::SelectFirst, Some("picker")), diff --git a/crates/tab_switcher/src/tab_switcher_tests.rs b/crates/tab_switcher/src/tab_switcher_tests.rs index 35c53f4dbdacbe4fac7c273e9b5e1d5fe3b6331d..a1b53faf58f03d440afe6484296e654bda35bd7f 100644 --- a/crates/tab_switcher/src/tab_switcher_tests.rs +++ b/crates/tab_switcher/src/tab_switcher_tests.rs @@ -1,7 +1,7 @@ use super::*; use editor::Editor; use gpui::{TestAppContext, VisualTestContext}; -use menu::SelectPrev; +use menu::SelectPrevious; use project::{Project, ProjectPath}; use serde_json::json; use std::path::Path; @@ -64,7 +64,7 @@ async fn test_open_with_prev_tab_selected_and_cycle_on_toggle_action( assert_match_selection(tab_switcher, 3, tab_1.boxed_clone()); }); - cx.dispatch_action(SelectPrev); + cx.dispatch_action(SelectPrevious); tab_switcher.update(cx, |tab_switcher, _| { assert_eq!(tab_switcher.delegate.matches.len(), 4); assert_match_at_position(tab_switcher, 0, tab_4.boxed_clone()); diff --git a/crates/ui/src/components/context_menu.rs b/crates/ui/src/components/context_menu.rs index 84cdbdff4cf5dfba95b31e80f90dcf7b72edfea2..696f3e77bd21f1a14c0000c9f12370ae6236ab7e 100644 --- a/crates/ui/src/components/context_menu.rs +++ b/crates/ui/src/components/context_menu.rs @@ -6,7 +6,7 @@ use gpui::{ px, Action, AnyElement, App, AppContext as _, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable, IntoElement, Render, Subscription, }; -use menu::{SelectFirst, SelectLast, SelectNext, SelectPrev}; +use menu::{SelectFirst, SelectLast, SelectNext, SelectPrevious}; use settings::Settings; use std::{rc::Rc, time::Duration}; use theme::ThemeSettings; @@ -410,7 +410,12 @@ impl ContextMenu { } } - pub fn select_prev(&mut self, _: &SelectPrev, window: &mut Window, cx: &mut Context) { + pub fn select_previous( + &mut self, + _: &SelectPrevious, + window: &mut Window, + cx: &mut Context, + ) { if let Some(ix) = self.selected_index { if ix == 0 { self.handle_select_last(&SelectLast, window, cx); @@ -555,7 +560,7 @@ impl Render for ContextMenu { .on_action(cx.listener(ContextMenu::select_first)) .on_action(cx.listener(ContextMenu::handle_select_last)) .on_action(cx.listener(ContextMenu::select_next)) - .on_action(cx.listener(ContextMenu::select_prev)) + .on_action(cx.listener(ContextMenu::select_previous)) .on_action(cx.listener(ContextMenu::confirm)) .on_action(cx.listener(ContextMenu::cancel)) .when(!self.delayed, |mut el| { diff --git a/crates/ui/src/components/navigable.rs b/crates/ui/src/components/navigable.rs index a9b7fa9c5d4f6b2d4d9123c9f31ee7f3e754001d..52d7128b7a806e2f31782e74c69ac9085f890dbc 100644 --- a/crates/ui/src/components/navigable.rs +++ b/crates/ui/src/components/navigable.rs @@ -44,7 +44,7 @@ impl Navigable { /// Add a new entry that can be navigated to via keyboard. /// /// The order of calls to [Navigable::entry] determines the order of traversal of - /// elements via successive uses of `menu:::SelectNext/SelectPrev` + /// elements via successive uses of `menu:::SelectNext/SelectPrevious` pub fn entry(mut self, child: NavigableEntry) -> Self { self.selectable_children.push(child); self @@ -83,7 +83,7 @@ impl RenderOnce for Navigable { }) .on_action({ let children = self.selectable_children; - move |_: &menu::SelectPrev, window, cx| { + move |_: &menu::SelectPrevious, window, cx| { let target = Self::find_focused(&children, window, cx) .and_then(|index| index.checked_sub(1)) .or(children.len().checked_sub(1)); diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index 12b7211b8e6c8a1ee68dd8fca398291069a7a80f..b32520664e8d84f454241c718b8468f3b92122e7 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -827,10 +827,12 @@ fn generate_commands(_: &App) -> Vec { VimCommand::new(("cc", ""), editor::actions::Hover), VimCommand::new(("ll", ""), editor::actions::Hover), VimCommand::new(("cn", "ext"), editor::actions::GoToDiagnostic).range(wrap_count), - VimCommand::new(("cp", "revious"), editor::actions::GoToPrevDiagnostic).range(wrap_count), - VimCommand::new(("cN", "ext"), editor::actions::GoToPrevDiagnostic).range(wrap_count), - VimCommand::new(("lp", "revious"), editor::actions::GoToPrevDiagnostic).range(wrap_count), - VimCommand::new(("lN", "ext"), editor::actions::GoToPrevDiagnostic).range(wrap_count), + VimCommand::new(("cp", "revious"), editor::actions::GoToPreviousDiagnostic) + .range(wrap_count), + VimCommand::new(("cN", "ext"), editor::actions::GoToPreviousDiagnostic).range(wrap_count), + VimCommand::new(("lp", "revious"), editor::actions::GoToPreviousDiagnostic) + .range(wrap_count), + VimCommand::new(("lN", "ext"), editor::actions::GoToPreviousDiagnostic).range(wrap_count), VimCommand::new(("j", "oin"), JoinLines).range(select_range), VimCommand::new(("fo", "ld"), editor::actions::FoldSelectedRanges).range(act_on_range), VimCommand::new(("foldo", "pen"), editor::actions::UnfoldLines) diff --git a/crates/zed/src/zed/app_menus.rs b/crates/zed/src/zed/app_menus.rs index ec5dc29ee8ddb9978b02923314eaa6c5332f99c0..4d72068f90be42f4596cce32b46c12ff6f817f79 100644 --- a/crates/zed/src/zed/app_menus.rs +++ b/crates/zed/src/zed/app_menus.rs @@ -189,7 +189,7 @@ pub fn app_menus() -> Vec { MenuItem::action("Find All References", editor::actions::FindAllReferences), MenuItem::separator(), MenuItem::action("Next Problem", editor::actions::GoToDiagnostic), - MenuItem::action("Previous Problem", editor::actions::GoToPrevDiagnostic), + MenuItem::action("Previous Problem", editor::actions::GoToPreviousDiagnostic), ], }, Menu { diff --git a/crates/zed/src/zed/linux_prompts.rs b/crates/zed/src/zed/linux_prompts.rs index e6c2bf62b1c882e0f9e6c27efea8a7fd17a9560b..20cd14c4444778d86716c5263505f6711460570e 100644 --- a/crates/zed/src/zed/linux_prompts.rs +++ b/crates/zed/src/zed/linux_prompts.rs @@ -102,7 +102,12 @@ impl FallbackPromptRenderer { cx.notify(); } - fn select_prev(&mut self, _: &menu::SelectPrev, _window: &mut Window, cx: &mut Context) { + fn select_previous( + &mut self, + _: &menu::SelectPrevious, + _window: &mut Window, + cx: &mut Context, + ) { self.active_action_id = (self.active_action_id + 1) % self.actions.len(); cx.notify(); } @@ -119,7 +124,7 @@ impl Render for FallbackPromptRenderer { .on_action(cx.listener(Self::confirm)) .on_action(cx.listener(Self::cancel)) .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_first)) .on_action(cx.listener(Self::select_last)) .elevation_3(cx) diff --git a/crates/zed/src/zed/quick_action_bar.rs b/crates/zed/src/zed/quick_action_bar.rs index 21ef7db7cc6c1532a6ed92a6a8180d70953a3a29..4da1a13148bf33fedc5c623130e9aab8369caf46 100644 --- a/crates/zed/src/zed/quick_action_bar.rs +++ b/crates/zed/src/zed/quick_action_bar.rs @@ -5,8 +5,8 @@ use assistant::AssistantPanel; use assistant_settings::AssistantSettings; use editor::actions::{ AddSelectionAbove, AddSelectionBelow, DuplicateLineDown, GoToDiagnostic, GoToHunk, - GoToPrevDiagnostic, GoToPrevHunk, MoveLineDown, MoveLineUp, SelectAll, SelectLargerSyntaxNode, - SelectNext, SelectSmallerSyntaxNode, ToggleGoToLine, + GoToPreviousDiagnostic, GoToPreviousHunk, MoveLineDown, MoveLineUp, SelectAll, + SelectLargerSyntaxNode, SelectNext, SelectSmallerSyntaxNode, ToggleGoToLine, }; use editor::{Editor, EditorSettings}; use gpui::{ @@ -180,10 +180,10 @@ impl Render for QuickActionBar { .action("Go to Line/Column", Box::new(ToggleGoToLine)) .separator() .action("Next Problem", Box::new(GoToDiagnostic)) - .action("Previous Problem", Box::new(GoToPrevDiagnostic)) + .action("Previous Problem", Box::new(GoToPreviousDiagnostic)) .separator() .action("Next Hunk", Box::new(GoToHunk)) - .action("Previous Hunk", Box::new(GoToPrevHunk)) + .action("Previous Hunk", Box::new(GoToPreviousHunk)) .separator() .action("Move Line Up", Box::new(MoveLineUp)) .action("Move Line Down", Box::new(MoveLineDown)) diff --git a/crates/zeta/src/rate_completion_modal.rs b/crates/zeta/src/rate_completion_modal.rs index 28c1dad1f18bbe2c88303c468429c63996801685..9e4ad6c79b13fffa3f28cc62b7d594d5c46e5cf8 100644 --- a/crates/zeta/src/rate_completion_modal.rs +++ b/crates/zeta/src/rate_completion_modal.rs @@ -82,7 +82,12 @@ impl RateCompletionModal { cx.notify(); } - fn select_prev(&mut self, _: &menu::SelectPrev, _: &mut Window, cx: &mut Context) { + fn select_previous( + &mut self, + _: &menu::SelectPrevious, + _: &mut Window, + cx: &mut Context, + ) { self.selected_index = self.selected_index.saturating_sub(1); cx.notify(); } @@ -529,7 +534,7 @@ impl Render for RateCompletionModal { .track_focus(&self.focus_handle) .on_action(cx.listener(Self::dismiss)) .on_action(cx.listener(Self::confirm)) - .on_action(cx.listener(Self::select_prev)) + .on_action(cx.listener(Self::select_previous)) .on_action(cx.listener(Self::select_prev_edit)) .on_action(cx.listener(Self::select_next)) .on_action(cx.listener(Self::select_next_edit))