Compare commits

...

13 Commits

Author SHA1 Message Date
Zed Bot
fbfa89356e Bump to 0.176.3 for @maxdeviant 2025-03-06 21:58:23 +00:00
gcp-cherry-pick-bot[bot]
ce37c2634e language_models: Remove .unwraps in Bedrock provider (cherry-pick #26238) (#26242)
Cherry-picked language_models: Remove `.unwrap`s in Bedrock provider
(#26238)

This PR removes a number of `.unwrap`s in the Bedrock provider.

We must not `.unwrap` in situations where it is not provably safe to do
so, which it was not in any of these cases.

Release Notes:

- Fixed some potential panics in the AWS Bedrock model provider.

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-03-06 16:49:58 -05:00
smit
efe4418b9a on stable, this action only exists as string. 2025-03-04 22:58:07 +05:30
Joseph T. Lyons
64b2ddca38 zed 0.176.2 2025-03-04 12:14:05 -05:00
gcp-cherry-pick-bot[bot]
4468d1925d Fix a panic on Linux theme appearance change (cherry-pick #26019) (#26029)
Cherry-picked Fix a panic on Linux theme appearance change (#26019)

Closes https://github.com/zed-industries/zed/issues/26009



21484a2e9d/crates/gpui/src/platform/linux/platform.rs (L517-L519)

`with_common` panicked at `borrow_mut` which is the way it's implemented
for X11, Wayland and Headless Linux counterparts.



21484a2e9d/crates/gpui/src/platform/linux/wayland/client.rs (L722-L724)

By accessing the appearance global instead of a `RefCell` with it, the
panic goes away with one notable side-effect, on Linux only: the first
global's value on `Dark` appearance would be `Light`: it becomes normal
instantly, thanks to



21484a2e9d/crates/workspace/src/workspace.rs (L1083-L1090)

Things work without flickering:



[linux_theme_toggle.webm](https://github.com/user-attachments/assets/0e39ddc0-b4ff-4475-93ff-7b2bd7233628)


Release Notes:

- Fixed a panic on Linux theme appearance change

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-03-04 15:14:41 +02:00
smit
8d16ddbad8 keymap: Update Prev to Previous follow-up (#25931)
Follow-up for https://github.com/zed-industries/zed/pull/25909

Add three more action replacements:

```
1. "pane::ActivatePrevItem" -> "pane::ActivatePreviousItem"
2. "vim::MoveToPrev" -> "vim::MoveToPrevious"
3. "vim:MoveToPrevMatch" -> "vim:MoveToPreviousMatch"
```

Release Notes:

- N/A
2025-03-04 13:14:56 +05:30
smit
21dd8c21b8 keymap: Update Prev to Previous for consistency (#25909)
Closes #10167

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

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

Release Notes:

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

Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
2025-03-04 13:13:35 +05:30
Joseph T. Lyons
121bd97cb1 v0.176.x stable 2025-03-03 12:42:43 -05:00
gcp-cherry-pick-bot[bot]
2433e99d05 Reset buffer language on buffer search redeploy (cherry-pick #25797) (#25798)
Cherry-picked Reset buffer language on buffer search redeploy (#25797)

Closes https://github.com/zed-industries/zed/issues/25792

Release Notes:

- Fixed search input regex highlight not going away after redeploy

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-02-28 10:28:59 +02:00
Zed Bot
c75c2276b0 Bump to 0.176.1 for @maxdeviant 2025-02-27 16:45:00 +00:00
gcp-cherry-pick-bot[bot]
3659466f5b lsp: Use available workspace folders in initialize params (cherry-pick #25753) (#25757)
Cherry-picked lsp: Use available workspace folders in initialize params
(#25753)

Closes https://github.com/zed-industries/zed/issues/25743
Closes https://github.com/biomejs/biome-zed/issues/73

Release Notes:

- Fixed issues with launching Svelte/Biome language servers

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-02-27 11:41:59 -05:00
gcp-cherry-pick-bot[bot]
a82d7aa2a9 vim: Fix search submit panic (cherry-pick #25673) (#25717)
Cherry-picked vim: Fix search submit panic (#25673)

In file search submit action, handle unwrap when there are no prior
selection.

Release Notes:

- vim: Fixed a panic when submitting a search.

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>

Co-authored-by: smit <0xtimsb@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
2025-02-26 20:50:42 -05:00
Joseph T. Lyons
977e051983 v0.176.x preview 2025-02-26 12:52:09 -05:00
56 changed files with 1931 additions and 562 deletions

2
Cargo.lock generated
View File

@@ -16732,7 +16732,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.176.0"
version = "0.176.3"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -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",
@@ -272,26 +319,61 @@
"alt-8": ["pane::ActivateItem", 7],
"alt-9": ["pane::ActivateItem", 8],
"alt-0": "pane::ActivateLastItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pageup": "pane::ActivatePreviousItem",
"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"
}

View File

@@ -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",
@@ -352,22 +458,52 @@
"context": "Pane",
"use_key_equivalents": true,
"bindings": {
"alt-cmd-left": "pane::ActivatePrevItem",
"cmd-{": "pane::ActivatePrevItem",
"alt-cmd-left": "pane::ActivatePreviousItem",
"cmd-{": "pane::ActivatePreviousItem",
"alt-cmd-right": "pane::ActivateNextItem",
"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"
}
}
]
]

View File

@@ -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
}
},
{

View File

@@ -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"
}
},

View File

@@ -2,15 +2,25 @@
{
"bindings": {
"ctrl-alt-s": "zed::OpenSettings",
"ctrl-{": "pane::ActivatePrevItem",
"ctrl-{": "pane::ActivatePreviousItem",
"ctrl-}": "pane::ActivateNextItem"
}
},
{
"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"
}
}
]
]

View File

@@ -1,28 +1,101 @@
[
{
"bindings": {
"ctrl-{": "pane::ActivatePrevItem",
"ctrl-{": "pane::ActivatePreviousItem",
"ctrl-}": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pageup": "pane::ActivatePreviousItem",
"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"
}
}
]
]

View File

@@ -40,7 +40,7 @@
"context": "BufferSearchBar",
"bindings": {
"cmd-f3": "search::SelectNextMatch",
"cmd-shift-f3": "search::SelectPrevMatch"
"cmd-shift-f3": "search::SelectPreviousMatch"
}
},
{

View File

@@ -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"
}
},

View File

@@ -1,15 +1,25 @@
[
{
"bindings": {
"cmd-{": "pane::ActivatePrevItem",
"cmd-{": "pane::ActivatePreviousItem",
"cmd-}": "pane::ActivateNextItem"
}
},
{
"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"
}
}

View File

@@ -1,28 +1,101 @@
[
{
"bindings": {
"cmd-{": "pane::ActivatePrevItem",
"cmd-{": "pane::ActivatePreviousItem",
"cmd-}": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pageup": "pane::ActivatePreviousItem",
"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"
}
}
]
]

View File

@@ -47,7 +47,7 @@
"context": "BufferSearchBar",
"bindings": {
"ctrl-s": "search::SelectNextMatch",
"ctrl-shift-s": "search::SelectPrevMatch"
"ctrl-shift-s": "search::SelectPreviousMatch"
}
},
{

View File

@@ -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",

View File

@@ -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",
"#": "vim::MoveToPrevious",
"n": "vim::MoveToNextMatch",
"shift-n": "vim::MoveToPrevMatch",
"shift-n": "vim::MoveToPreviousMatch",
"%": "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",
@@ -106,7 +191,7 @@
"g g": "vim::StartOfDocument",
"g h": "editor::Hover",
"g t": "pane::ActivateNextItem",
"g shift-t": "pane::ActivatePrevItem",
"g shift-t": "pane::ActivatePreviousItem",
"g d": "editor::GoToDefinition",
"g shift-d": "editor::GoToDeclaration",
"g y": "editor::GoToTypeDefinition",
@@ -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::MoveToPrevious",
{
"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",
@@ -231,22 +438,25 @@
"g w": "vim::PushRewrap",
"g q": "vim::PushRewrap",
"ctrl-pagedown": "pane::ActivateNextItem",
"ctrl-pageup": "pane::ActivatePrevItem",
"ctrl-pageup": "pane::ActivatePreviousItem",
"insert": "vim::InsertBefore",
// tree-sitter related commands
"[ 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::MoveToPrevious",
{
"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"
]
]
}
},
{
@@ -620,8 +1139,8 @@
"ctrl-w =": "vim::ResetPaneSizes",
"ctrl-w g t": "pane::ActivateNextItem",
"ctrl-w ctrl-g t": "pane::ActivateNextItem",
"ctrl-w g shift-t": "pane::ActivatePrevItem",
"ctrl-w ctrl-g shift-t": "pane::ActivatePrevItem",
"ctrl-w g shift-t": "pane::ActivatePreviousItem",
"ctrl-w ctrl-g shift-t": "pane::ActivatePreviousItem",
"ctrl-w w": "workspace::ActivateNextPane",
"ctrl-w ctrl-w": "workspace::ActivateNextPane",
"ctrl-w p": "workspace::ActivatePreviousPane",
@@ -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"
}
}
]
]

View File

@@ -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<Self>,
) {
@@ -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))

View File

@@ -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<Self>) {
fn select_previous(&mut self, _: &SelectPrevious, _: &mut Window, cx: &mut Context<Self>) {
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))

View File

@@ -475,6 +475,7 @@ impl Copilot {
binary,
root_path,
None,
Default::default(),
cx.clone(),
)?;

View File

@@ -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,

View File

@@ -7165,7 +7165,7 @@ impl Editor {
});
}
pub fn tab_prev(&mut self, _: &TabPrev, window: &mut Window, cx: &mut Context<Self>) {
pub fn backtab(&mut self, _: &Backtab, window: &mut Window, cx: &mut Context<Self>) {
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<Self>,
) {
@@ -11228,7 +11228,7 @@ impl Editor {
fn go_to_prev_diagnostic(
&mut self,
_: &GoToPrevDiagnostic,
_: &GoToPreviousDiagnostic,
window: &mut Window,
cx: &mut Context<Self>,
) {
@@ -11411,7 +11411,12 @@ impl Editor {
hunk
}
fn go_to_prev_hunk(&mut self, _: &GoToPrevHunk, window: &mut Window, cx: &mut Context<Self>) {
fn go_to_prev_hunk(
&mut self,
_: &GoToPreviousHunk,
window: &mut Window,
cx: &mut Context<Self>,
) {
let snapshot = self.snapshot(window, cx);
let selection = self.selections.newest::<Point>(cx);
self.go_to_hunk_before_position(&snapshot, selection.head(), window, cx);

View File

@@ -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.

View File

@@ -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,

View File

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

View File

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

View File

@@ -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<Self>) {
fn select_previous(
&mut self,
_: &SelectPrevious,
_window: &mut Window,
cx: &mut Context<Self>,
) {
let item_count = self.entries.len();
if item_count == 0 {
return;
@@ -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))

View File

@@ -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(

View File

@@ -401,7 +401,7 @@ impl LanguageModel for BedrockModel {
let request = self.stream_completion(request, cx);
let future = self.request_limiter.stream(async move {
let response = request.map_err(|e| anyhow!(e)).unwrap().await;
let response = request.map_err(|err| anyhow!(err))?.await;
Ok(map_to_language_model_completion_events(
response,
owned_handle,
@@ -425,26 +425,28 @@ impl LanguageModel for BedrockModel {
self.model.max_output_tokens(),
);
request.tool_choice = Some(BedrockToolChoice::Tool(
BedrockSpecificTool::builder()
.name(name.clone())
.build()
.unwrap(),
));
request.tool_choice = BedrockSpecificTool::builder()
.name(name.clone())
.build()
.log_err()
.map(BedrockToolChoice::Tool);
request.tools = vec![BedrockTool::builder()
if let Some(tool) = BedrockTool::builder()
.name(name.clone())
.description(description.clone())
.input_schema(BedrockToolInputSchema::Json(value_to_aws_document(&schema)))
.build()
.unwrap()];
.log_err()
{
request.tools.push(tool);
}
let handle = self.handler.clone();
let request = self.stream_completion(request, _cx);
self.request_limiter
.run(async move {
let response = request.map_err(|e| anyhow!(e)).unwrap().await;
let response = request.map_err(|err| anyhow!(err))?.await;
Ok(extract_tool_args_from_events(name, response, handle)
.await?
.boxed())
@@ -758,7 +760,8 @@ pub fn map_to_language_model_completion_events(
None
})
.await
.unwrap()
.log_err()
.flatten()
}
},
)

View File

@@ -5,7 +5,7 @@ use futures::StreamExt;
use gpui::{App, AsyncApp, Task};
use http_client::github::latest_github_release;
pub use language::*;
use lsp::{InitializeParams, LanguageServerBinary, LanguageServerName};
use lsp::{LanguageServerBinary, LanguageServerName};
use project::Fs;
use regex::Regex;
use serde_json::json;
@@ -373,14 +373,6 @@ impl super::LspAdapter for GoLspAdapter {
filter_range,
})
}
fn prepare_initialize_params(
&self,
mut original: InitializeParams,
) -> Result<InitializeParams> {
#[allow(deprecated)]
let _ = original.root_uri.take();
Ok(original)
}
}
fn parse_version_output(output: &Output) -> Result<&str> {

View File

@@ -329,6 +329,7 @@ impl lsp_types::notification::Notification for ServerStatus {
impl LanguageServer {
/// Starts a language server process.
#[allow(clippy::too_many_arguments)]
pub fn new(
stderr_capture: Arc<Mutex<Option<String>>>,
server_id: LanguageServerId,
@@ -336,6 +337,7 @@ impl LanguageServer {
binary: LanguageServerBinary,
root_path: &Path,
code_action_kinds: Option<Vec<CodeActionKind>>,
workspace_folders: Arc<Mutex<BTreeSet<Url>>>,
cx: AsyncApp,
) -> Result<Self> {
let working_dir = if root_path.is_dir() {
@@ -383,6 +385,7 @@ impl LanguageServer {
code_action_kinds,
binary,
root_uri,
workspace_folders,
cx,
move |notification| {
log::info!(
@@ -409,6 +412,7 @@ impl LanguageServer {
code_action_kinds: Option<Vec<CodeActionKind>>,
binary: LanguageServerBinary,
root_uri: Url,
workspace_folders: Arc<Mutex<BTreeSet<Url>>>,
cx: AsyncApp,
on_unhandled_notification: F,
) -> Self
@@ -491,7 +495,7 @@ impl LanguageServer {
io_tasks: Mutex::new(Some((input_task, output_task))),
output_done_rx: Mutex::new(Some(output_done_rx)),
server: Arc::new(Mutex::new(server)),
workspace_folders: Default::default(),
workspace_folders,
root_uri,
}
}
@@ -617,6 +621,16 @@ impl LanguageServer {
}
pub fn default_initialize_params(&self, cx: &App) -> InitializeParams {
let workspace_folders = self
.workspace_folders
.lock()
.iter()
.cloned()
.map(|uri| WorkspaceFolder {
name: Default::default(),
uri,
})
.collect::<Vec<_>>();
#[allow(deprecated)]
InitializeParams {
process_id: None,
@@ -791,7 +805,7 @@ impl LanguageServer {
}),
},
trace: None,
workspace_folders: Some(vec![]),
workspace_folders: Some(workspace_folders),
client_info: release_channel::ReleaseChannel::try_global(cx).map(|release_channel| {
ClientInfo {
name: release_channel.display_name().to_string(),
@@ -1260,24 +1274,27 @@ impl LanguageServer {
}
pub fn set_workspace_folders(&self, folders: BTreeSet<Url>) {
let mut workspace_folders = self.workspace_folders.lock();
let old_workspace_folders = std::mem::take(&mut *workspace_folders);
let added: Vec<_> = folders
.iter()
.difference(&old_workspace_folders)
.map(|uri| WorkspaceFolder {
uri: uri.clone(),
name: String::default(),
})
.collect();
let removed: Vec<_> = std::mem::replace(&mut *workspace_folders, folders)
.into_iter()
let removed: Vec<_> = old_workspace_folders
.difference(&folders)
.map(|uri| WorkspaceFolder {
uri: uri.clone(),
name: String::default(),
})
.collect();
let should_notify = !added.is_empty() || !removed.is_empty();
if should_notify {
*workspace_folders = folders;
drop(workspace_folders);
let params = DidChangeWorkspaceFoldersParams {
event: WorkspaceFoldersChangeEvent { added, removed },
};
@@ -1392,6 +1409,7 @@ impl FakeLanguageServer {
let server_name = LanguageServerName(name.clone().into());
let process_name = Arc::from(name.as_str());
let root = Self::root_path();
let workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let mut server = LanguageServer::new_internal(
server_id,
server_name.clone(),
@@ -1403,6 +1421,7 @@ impl FakeLanguageServer {
None,
binary.clone(),
root,
workspace_folders.clone(),
cx.clone(),
|_| {},
);
@@ -1421,6 +1440,7 @@ impl FakeLanguageServer {
None,
binary,
Self::root_path(),
workspace_folders,
cx.clone(),
move |msg| {
notifications_tx

View File

@@ -15,7 +15,7 @@ actions!(
Cancel,
Confirm,
SecondaryConfirm,
SelectPrev,
SelectPrevious,
SelectNext,
SelectFirst,
SelectLast,

View File

@@ -424,20 +424,33 @@ static STRING_REPLACE: LazyLock<HashMap<&str, &str>> = 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"),
("pane::ActivatePrevItem", "pane::ActivatePreviousItem"),
("vim::MoveToPrev", "vim::MoveToPrevious"),
("vim::MoveToPrevMatch", "vim::MoveToPreviousMatch"),
("editor::GoToPrevHunk", "editor::GoToPreviousHunk"),
])
});
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,

View File

@@ -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),

View File

@@ -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<Self>) {
fn select_previous(&mut self, _: &SelectPrevious, window: &mut Window, cx: &mut Context<Self>) {
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()

View File

@@ -391,7 +391,12 @@ impl<D: PickerDelegate> Picker<D> {
}
}
fn select_prev(&mut self, _: &menu::SelectPrev, window: &mut Window, cx: &mut Context<Self>) {
fn select_previous(
&mut self,
_: &menu::SelectPrevious,
window: &mut Window,
cx: &mut Context<Self>,
) {
let count = self.delegate.match_count();
if count > 0 {
let index = self.delegate.selected_index();
@@ -786,7 +791,7 @@ impl<D: PickerDelegate> Render for Picker<D> {
// 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))

View File

@@ -279,6 +279,7 @@ impl Prettier {
server_binary,
&prettier_dir,
None,
Default::default(),
cx.clone(),
)
.context("prettier server creation")?;

View File

@@ -206,14 +206,14 @@ impl LocalLspStore {
);
let binary = self.get_language_server_binary(adapter.clone(), delegate.clone(), true, cx);
let pending_workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let pending_server = cx.spawn({
let adapter = adapter.clone();
let server_name = adapter.name.clone();
let stderr_capture = stderr_capture.clone();
#[cfg(any(test, feature = "test-support"))]
let lsp_store = self.weak.clone();
let pending_workspace_folders = pending_workspace_folders.clone();
move |cx| async move {
let binary = binary.await?;
#[cfg(any(test, feature = "test-support"))]
@@ -239,12 +239,12 @@ impl LocalLspStore {
binary,
&root_path,
adapter.code_action_kinds(),
pending_workspace_folders,
cx,
)
}
});
let pending_workspace_folders: Arc<Mutex<BTreeSet<Url>>> = Default::default();
let startup = {
let server_name = adapter.name.0.clone();
let delegate = delegate as Arc<dyn LspAdapterDelegate>;
@@ -7551,10 +7551,11 @@ impl LspStore {
// Update language_servers collection with Running variant of LanguageServerState
// indicating that the server is up and running and ready
let workspace_folders = workspace_folders.lock().clone();
local.language_servers.insert(
server_id,
LanguageServerState::running(
workspace_folders.lock().clone(),
workspace_folders,
adapter.clone(),
language_server.clone(),
None,

View File

@@ -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<Self>) {
fn select_previous(&mut self, _: &SelectPrevious, window: &mut Window, cx: &mut Context<Self>) {
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);

View File

@@ -245,7 +245,7 @@ impl NotebookEditor {
pub fn select_previous(
&mut self,
_: &menu::SelectPrev,
_: &menu::SelectPrevious,
window: &mut Window,
cx: &mut Context<Self>,
) {

View File

@@ -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 {
@@ -820,6 +822,7 @@ impl BufferSearchBar {
}
self.dismissed = false;
self.adjust_query_regex_language(cx);
handle.search_bar_visibility_changed(true, window, cx);
cx.notify();
cx.emit(Event::UpdateLocation);
@@ -991,7 +994,7 @@ impl BufferSearchBar {
fn select_prev_match(
&mut self,
_: &SelectPrevMatch,
_: &SelectPreviousMatch,
window: &mut Window,
cx: &mut Context<Self>,
) {
@@ -1328,7 +1331,7 @@ impl BufferSearchBar {
cx.stop_propagation();
}
fn tab_prev(&mut self, _: &TabPrev, window: &mut Window, cx: &mut Context<Self>) {
fn backtab(&mut self, _: &Backtab, window: &mut Window, cx: &mut Context<Self>) {
// Search -> Replace -> Search
let focus_handle = if self.replace_enabled && self.query_editor_focused {
self.replacement_editor.focus_handle(cx)
@@ -1694,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)]
@@ -1705,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)]
@@ -1716,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)]
@@ -1737,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)]
@@ -1779,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)]
@@ -1821,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)]
@@ -2034,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();
@@ -2042,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| {

View File

@@ -1,7 +1,7 @@
use crate::{
buffer_search::Deploy, BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery,
ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPrevMatch, ToggleCaseSensitive,
ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPreviousMatch,
ToggleCaseSensitive, ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
};
use anyhow::Context as _;
use collections::{HashMap, HashSet};
@@ -90,7 +90,7 @@ pub fn init(cx: &mut App) {
);
register_workspace_action(
workspace,
move |search_bar, action: &SelectPrevMatch, window, cx| {
move |search_bar, action: &SelectPreviousMatch, window, cx| {
search_bar.select_prev_match(action, window, cx)
},
);
@@ -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<Self>,
) {
@@ -1696,7 +1696,7 @@ impl ProjectSearchBar {
fn select_prev_match(
&mut self,
_: &SelectPrevMatch,
_: &SelectPreviousMatch,
window: &mut Window,
cx: &mut Context<Self>,
) {
@@ -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)))

View File

@@ -30,7 +30,7 @@ actions!(
ToggleReplace,
ToggleSelection,
SelectNextMatch,
SelectPrevMatch,
SelectPreviousMatch,
SelectAllMatches,
NextHistoryQuery,
PreviousHistoryQuery,

View File

@@ -620,7 +620,7 @@ mod tests {
// Standard macOS bindings
{
\"bindings\": {
\"up\": \"menu::SelectPrev\",
\"up\": \"menu::SelectPrevious\",
},
},
]

View File

@@ -114,10 +114,10 @@ impl PickerStory {
pub fn new(window: &mut Window, cx: &mut App) -> Entity<Self> {
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")),

View File

@@ -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());

View File

@@ -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<Self>) {
pub fn select_previous(
&mut self,
_: &SelectPrevious,
window: &mut Window,
cx: &mut Context<Self>,
) {
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| {

View File

@@ -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));

View File

@@ -784,8 +784,8 @@ fn generate_commands(_: &App) -> Vec<VimCommand> {
close_pinned: true,
}),
VimCommand::new(("bn", "ext"), workspace::ActivateNextItem).count(),
VimCommand::new(("bN", "ext"), workspace::ActivatePrevItem).count(),
VimCommand::new(("bp", "revious"), workspace::ActivatePrevItem).count(),
VimCommand::new(("bN", "ext"), workspace::ActivatePreviousItem).count(),
VimCommand::new(("bp", "revious"), workspace::ActivatePreviousItem).count(),
VimCommand::new(("bf", "irst"), workspace::ActivateItem(0)),
VimCommand::new(("br", "ewind"), workspace::ActivateItem(0)),
VimCommand::new(("bl", "ast"), workspace::ActivateLastItem),
@@ -794,8 +794,8 @@ fn generate_commands(_: &App) -> Vec<VimCommand> {
VimCommand::new(("tabe", "dit"), workspace::NewFile),
VimCommand::new(("tabnew", ""), workspace::NewFile),
VimCommand::new(("tabn", "ext"), workspace::ActivateNextItem).count(),
VimCommand::new(("tabp", "revious"), workspace::ActivatePrevItem).count(),
VimCommand::new(("tabN", "ext"), workspace::ActivatePrevItem).count(),
VimCommand::new(("tabp", "revious"), workspace::ActivatePreviousItem).count(),
VimCommand::new(("tabN", "ext"), workspace::ActivatePreviousItem).count(),
VimCommand::new(
("tabc", "lose"),
workspace::CloseActiveItem {
@@ -827,10 +827,12 @@ fn generate_commands(_: &App) -> Vec<VimCommand> {
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)

View File

@@ -28,7 +28,7 @@ pub(crate) struct MoveToNext {
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq)]
#[serde(deny_unknown_fields)]
pub(crate) struct MoveToPrev {
pub(crate) struct MoveToPrevious {
#[serde(default = "default_true")]
case_sensitive: bool,
#[serde(default)]
@@ -67,15 +67,15 @@ pub(crate) struct Replacement {
is_case_sensitive: bool,
}
actions!(vim, [SearchSubmit, MoveToNextMatch, MoveToPrevMatch]);
impl_actions!(vim, [FindCommand, Search, MoveToPrev, MoveToNext]);
actions!(vim, [SearchSubmit, MoveToNextMatch, MoveToPreviousMatch]);
impl_actions!(vim, [FindCommand, Search, MoveToPrevious, MoveToNext]);
impl_internal_actions!(vim, [ReplaceCommand]);
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
Vim::action(editor, cx, Vim::move_to_next);
Vim::action(editor, cx, Vim::move_to_prev);
Vim::action(editor, cx, Vim::move_to_previous);
Vim::action(editor, cx, Vim::move_to_next_match);
Vim::action(editor, cx, Vim::move_to_prev_match);
Vim::action(editor, cx, Vim::move_to_previous_match);
Vim::action(editor, cx, Vim::search);
Vim::action(editor, cx, Vim::search_deploy);
Vim::action(editor, cx, Vim::find_command);
@@ -94,7 +94,12 @@ impl Vim {
)
}
fn move_to_prev(&mut self, action: &MoveToPrev, window: &mut Window, cx: &mut Context<Self>) {
fn move_to_previous(
&mut self,
action: &MoveToPrevious,
window: &mut Window,
cx: &mut Context<Self>,
) {
self.move_to_internal(
Direction::Prev,
action.case_sensitive,
@@ -114,9 +119,9 @@ impl Vim {
self.move_to_match_internal(self.search.direction, window, cx)
}
fn move_to_prev_match(
fn move_to_previous_match(
&mut self,
_: &MoveToPrevMatch,
_: &MoveToPreviousMatch,
window: &mut Window,
cx: &mut Context<Self>,
) {
@@ -187,9 +192,13 @@ impl Vim {
let direction = self.search.direction;
search_bar.has_active_match();
let new_head = new_selections.last().unwrap().start;
let old_head = self.search.prior_selections.last().unwrap().start;
let is_different_head = self
.search
.prior_selections
.last()
.map_or(true, |range| range.start != new_head);
if new_head != old_head && self.search.direction == Direction::Next {
if is_different_head && self.search.direction == Direction::Next {
count = count.saturating_sub(1)
}
self.search.count = 1;

View File

@@ -172,7 +172,7 @@ impl_actions!(
actions!(
pane,
[
ActivatePrevItem,
ActivatePreviousItem,
ActivateNextItem,
ActivateLastItem,
AlternateFile,
@@ -3148,7 +3148,7 @@ impl Render for Pane {
}),
)
.on_action(
cx.listener(|pane: &mut Pane, _: &ActivatePrevItem, window, cx| {
cx.listener(|pane: &mut Pane, _: &ActivatePreviousItem, window, cx| {
pane.activate_prev_item(true, window, cx);
}),
)

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition.workspace = true
name = "zed"
version = "0.176.0"
version = "0.176.3"
publish.workspace = true
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
stable

View File

@@ -1078,7 +1078,7 @@ fn eager_load_active_theme_and_icon_theme(fs: Arc<dyn Fs>, cx: &App) {
let extension_store = ExtensionStore::global(cx);
let theme_registry = ThemeRegistry::global(cx);
let theme_settings = ThemeSettings::get_global(cx);
let appearance = cx.window_appearance().into();
let appearance = SystemAppearance::global(cx).0;
if let Some(theme_selection) = theme_settings.theme_selection.as_ref() {
let theme_name = theme_selection.theme(appearance);

View File

@@ -3879,7 +3879,7 @@ mod tests {
// From the Atom keymap
use workspace::ActivatePreviousPane;
// From the JetBrains keymap
use workspace::ActivatePrevItem;
use workspace::ActivatePreviousItem;
app_state
.fs
@@ -3920,7 +3920,7 @@ mod tests {
workspace.register_action(|_, _: &A, _window, _cx| {});
workspace.register_action(|_, _: &B, _window, _cx| {});
workspace.register_action(|_, _: &ActivatePreviousPane, _window, _cx| {});
workspace.register_action(|_, _: &ActivatePrevItem, _window, _cx| {});
workspace.register_action(|_, _: &ActivatePreviousItem, _window, _cx| {});
cx.notify();
})
.unwrap();
@@ -3969,7 +3969,7 @@ mod tests {
assert_key_bindings_for(
workspace.into(),
cx,
vec![("backspace", &B), ("{", &ActivatePrevItem)],
vec![("backspace", &B), ("{", &ActivatePreviousItem)],
line!(),
);
}

View File

@@ -189,7 +189,7 @@ pub fn app_menus() -> Vec<Menu> {
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 {

View File

@@ -102,7 +102,12 @@ impl FallbackPromptRenderer {
cx.notify();
}
fn select_prev(&mut self, _: &menu::SelectPrev, _window: &mut Window, cx: &mut Context<Self>) {
fn select_previous(
&mut self,
_: &menu::SelectPrevious,
_window: &mut Window,
cx: &mut Context<Self>,
) {
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)

View File

@@ -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))

View File

@@ -82,7 +82,12 @@ impl RateCompletionModal {
cx.notify();
}
fn select_prev(&mut self, _: &menu::SelectPrev, _: &mut Window, cx: &mut Context<Self>) {
fn select_previous(
&mut self,
_: &menu::SelectPrevious,
_: &mut Window,
cx: &mut Context<Self>,
) {
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))