Compare commits

...
10 Commits
Author SHA1 Message Date
dualfroz 752aa84b7a Describe this repository 2026-10-22 21:01:26 +02:00
dualfroz 5f70e7afe2 vim: Close popovers and expanded hunks on escape in Helix normal mode
In Helix normal mode escape runs `vim::SwitchToHelixNormalMode`, which
only switches the mode, so the diagnostic shown by `] d`, a hunk expanded
with `g o`, a hover popover and the like stayed open. Vim mode closes them
because escape there is `editor::Cancel`. Binding Helix to `Cancel` isn't
an option, since once nothing is open it collapses the selections.

Pull the part of `Editor::cancel` that runs before it touches the
selections into `Editor::dismiss_overlays`, and call it when escape is
pressed in Helix normal mode. Selections are kept as before.

Closes #55197
2026-10-03 02:13:23 +02:00
upstream 134c5e9f71 Upstream zed-industries/zed state of the touched files before c15197ead3 2026-10-03 02:13:23 +02:00
dualfroz 3a969493f7 vim: Fix changing and deleting surrounding quotes on soft wrapped lines
`cs"` and `ds"` did nothing when the line was soft wrapped and the quotes
ended up on different display rows. Quote objects only match on a single
line, and the surround code checked that by comparing display rows of
the cursor and the found pair, so a soft wrapped line looked like several.
The pair itself is found in the buffer text and was already correct.

Compare buffer rows instead, in both `ds` and `cs`. This also covers
`AnyQuotes` and `MiniQuotes`, which go through the same check.

Closes #43069
2026-10-03 02:08:06 +02:00
upstream f63c81cdcd Upstream zed-industries/zed state of the touched files before e55b79eb25 2026-10-03 02:08:06 +02:00
dualfroz 0b2a8d3999 vim: Keep command palette matches next to filename completions
With vim or helix mode on, searching the command palette for "split
selection" showed only a `:split selection` entry and hid
`editor: split selection into lines`. The vim interceptor reads the query
as `:split <file>`, and its filename completions were marked exclusive,
which drops every regular match. The same happens for other searches
that start with a filename command, like "edit prediction".

Return the completions as non-exclusive, like every other intercepted
command. They are still listed first, so `:sp foo` + enter behaves the
same.

Closes #64431
2026-10-03 02:05:03 +02:00
upstream 6ff5c0da84 Upstream zed-industries/zed state of the touched files before d0a35c7366 2026-10-03 02:05:03 +02:00
dualfroz 40b12a4e6c Fix shift-enter in buffer search with the JetBrains keymap
With the JetBrains base keymap, shift-enter in the buffer search query
inserted a newline instead of going to the previous match. The keymap
binds shift-enter to `editor::Newline` for auto-height editors, which
matches at the editor's depth, while its search bar binding only matched
at the `BufferSearchBar` level and lost to it. The default keymap's
`BufferSearchBar && !in_replace > Editor` binding loses too, since base
keymaps are loaded after it.

Bind it on the query editor itself, like the default keymaps and the
thread search binding right below it do, so it wins by coming later in
the same file.

Closes #62696
2026-10-03 02:02:28 +02:00
upstream a0a55b30d3 Upstream zed-industries/zed state of the touched files before 5769f6869d 2026-10-03 02:02:28 +02:00
dualfroz e3da47c875 terminal: Highlight links on ctrl/cmd-hover in mouse mode
When the running app had mouse reporting on, moving the pointer over a
link with ctrl/cmd held never underlined it, while pressing the modifier
with the pointer already on the link did. `mouse_move` only scheduled
the hyperlink lookup outside of mouse mode, but the modifier change and
grid refresh paths don't check it, and ctrl/cmd-click already opens
links in mouse mode through `open_links_in_mouse_mode`.

Also look up the hovered link in mouse mode when that setting is on,
after the motion has been reported to the app.

Closes #64102
2026-10-03 01:58:16 +02:00
10 changed files with 31228 additions and 0 deletions

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
# Contributions to zed-industries/zed
Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
This repository holds only my commits to the upstream project, with their original author, date and diff.
Each of my commits is preceded by a snapshot of the upstream files it touched, so every diff shows exactly what I changed.
## Merged pull requests
- [openai_subscribed: Keep loading slow model catalogs in the background](https://github.com/zed-industries/zed/pull/64925) (2026-10-01)
+229
View File
@@ -0,0 +1,229 @@
[
{
"bindings": {
"ctrl-alt-s": "zed::OpenSettings",
"ctrl-{": "pane::ActivatePreviousItem",
"ctrl-}": "pane::ActivateNextItem",
"shift-escape": null, // Unmap workspace::zoom
"ctrl-~": "git::Branch",
"ctrl-f2": "debugger::Stop",
"f6": "debugger::Pause",
"f7": "debugger::StepInto",
"f8": "debugger::StepOver",
"shift-f8": "debugger::StepOut",
"f9": "debugger::Continue",
"shift-f9": "debugger::Start",
"alt-shift-f9": "debugger::Start",
},
},
{
"context": "Editor",
"bindings": {
"ctrl->": ["zed::IncreaseBufferFontSize", { "persist": true }],
"ctrl-<": ["zed::DecreaseBufferFontSize", { "persist": true }],
"ctrl-shift-j": "editor::JoinLines",
"ctrl-d": "editor::DuplicateSelection",
"ctrl-y": "editor::DeleteLine",
"ctrl-m": "editor::ScrollCursorCenter",
"ctrl-pagedown": "editor::MovePageDown",
"ctrl-pageup": "editor::MovePageUp",
// "ctrl-alt-shift-b": "editor::SelectToPreviousWordStart",
"ctrl-alt-enter": "editor::NewlineAbove",
"shift-enter": "editor::NewlineBelow",
// "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, "comment_empty_lines": true }],
"ctrl-w": "editor::SelectLargerSyntaxNode",
"ctrl-shift-w": "editor::SelectSmallerSyntaxNode",
"shift-alt-up": "editor::MoveLineUp",
"shift-alt-down": "editor::MoveLineDown",
"ctrl-alt-l": "editor::Format",
"ctrl-alt-o": "editor::OrganizeImports",
"shift-f6": "editor::Rename",
"ctrl-alt-left": "pane::GoBack",
"ctrl-alt-right": "pane::GoForward",
"alt-f7": "editor::FindAllReferences",
"ctrl-alt-f7": "editor::FindAllReferences",
"ctrl-b": "editor::GoToDefinition", // Conflicts with workspace::ToggleLeftDock
"ctrl-alt-b": "editor::GoToImplementation", // Conflicts with workspace::ToggleRightDock
"ctrl-shift-b": "editor::GoToTypeDefinition",
"ctrl-alt-shift-b": "editor::GoToTypeDefinitionSplit",
"f2": "editor::GoToDiagnostic",
"shift-f2": "editor::GoToPreviousDiagnostic",
"ctrl-alt-shift-down": "editor::GoToHunk",
"ctrl-alt-shift-up": "editor::GoToPreviousHunk",
"ctrl-alt-z": "git::Restore",
"ctrl-home": "editor::MoveToBeginning",
"ctrl-end": "editor::MoveToEnd",
"ctrl-shift-home": "editor::SelectToBeginning",
"ctrl-shift-end": "editor::SelectToEnd",
"alt-left": "editor::MoveToPreviousSubwordStart",
"alt-right": "editor::MoveToNextSubwordEnd",
"shift-alt-left": "editor::SelectToPreviousSubwordStart",
"shift-alt-right": "editor::SelectToNextSubwordEnd",
"ctrl-f8": "editor::ToggleBreakpoint",
"ctrl-shift-f8": "editor::EditLogBreakpoint",
"ctrl-shift-u": "editor::ToggleCase",
},
},
{
"context": "Editor && mode == full",
"bindings": {
"ctrl-f12": "outline::Toggle",
"ctrl-r": ["buffer_search::Deploy", { "replace_enabled": true }],
"ctrl-e": "file_finder::Toggle",
"ctrl-shift-n": "file_finder::Toggle",
"ctrl-alt-n": "file_finder::Toggle",
"ctrl-g": "go_to_line::Toggle",
"alt-enter": "editor::ToggleCodeActions",
"ctrl-space": "editor::ShowCompletions",
"ctrl-q": "editor::Hover",
"ctrl-p": "editor::ShowSignatureHelp",
"ctrl-\\": "assistant::InlineAssist",
"ctrl-alt-h": "call_hierarchy::ShowIncomingCalls",
},
},
{
"context": "Editor && mode == auto_height",
"bindings": {
"shift-enter": "editor::Newline",
"ctrl-shift-enter": "editor::NewlineBelow",
},
},
{
"context": "BufferSearchBar && !in_replace > Editor",
"bindings": {
"shift-enter": "search::SelectPreviousMatch",
},
},
{
"context": "AcpThreadSearchBar > Editor",
"bindings": {
"shift-enter": "agent::SelectPreviousThreadMatch",
},
},
{
"context": "BufferSearchBar || ProjectSearchBar",
"bindings": {
"alt-c": "search::ToggleCaseSensitive",
"alt-e": "search::ToggleSelection",
"alt-x": "search::ToggleRegex",
"alt-w": "search::ToggleWholeWord",
},
},
{
"context": "Workspace",
"bindings": {
"ctrl-shift-f12": "workspace::ToggleAllDocks",
"ctrl-shift-r": ["pane::DeploySearch", { "replace_enabled": true }],
"alt-shift-f10": "task::Spawn",
"shift-f10": "task::Spawn",
"ctrl-f5": "task::Rerun",
"ctrl-e": "file_finder::Toggle",
"ctrl-k": "git_panel::ToggleFocus", // bug: This should also focus commit editor
"ctrl-shift-n": "file_finder::Toggle",
"ctrl-alt-n": "file_finder::Toggle",
"ctrl-n": "project_symbols::Toggle",
"ctrl-shift-a": "command_palette::Toggle",
"shift shift": "command_palette::Toggle",
"ctrl-alt-shift-n": "project_symbols::Toggle",
"alt-0": "git_panel::ToggleFocus",
"alt-1": "project_panel::ToggleFocus",
"alt-5": "debug_panel::ToggleFocus",
"alt-6": "diagnostics::Deploy",
"alt-7": "outline_panel::ToggleFocus",
},
},
{
"context": "Pane", // this is to override the default Pane mappings to switch tabs
"bindings": {
"alt-1": "project_panel::ToggleFocus",
"alt-2": null, // Bookmarks (left dock)
"alt-3": null, // Find Panel (bottom dock)
"alt-4": null, // Run Panel (bottom dock)
"alt-5": "debug_panel::ToggleFocus",
"alt-6": "diagnostics::Deploy",
"alt-7": "outline_panel::ToggleFocus",
"alt-8": null, // Services (bottom dock)
"alt-9": null, // Git History (bottom dock)
"alt-0": "git_panel::ToggleFocus",
},
},
{
"context": "Workspace || Editor",
"bindings": {
"alt-f12": "terminal_panel::Toggle",
"ctrl-shift-k": "git::Push",
},
},
{
"context": "Pane",
"bindings": {
"ctrl-alt-left": "pane::GoBack",
"ctrl-alt-right": "pane::GoForward",
"alt-left": "pane::ActivatePreviousItem",
"alt-right": "pane::ActivateNextItem",
},
},
{
"context": "ProjectPanel",
"bindings": {
"enter": "project_panel::Open",
"ctrl-shift-f": "project_panel::NewSearchInDirectory",
"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",
},
},
{
"context": "Terminal",
"bindings": {
"ctrl-shift-t": "workspace::NewTerminal",
"alt-f12": "workspace::CloseActiveDock",
"ctrl-up": "terminal::ScrollLineUp",
"ctrl-down": "terminal::ScrollLineDown",
"shift-pageup": "terminal::ScrollPageUp",
"shift-pagedown": "terminal::ScrollPageDown",
},
},
{ "context": "GitPanel", "bindings": { "alt-0": "workspace::CloseActiveDock" } },
{ "context": "ProjectPanel", "bindings": { "alt-1": "workspace::CloseActiveDock" } },
{ "context": "DebugPanel", "bindings": { "alt-5": "workspace::CloseActiveDock" } },
{ "context": "Diagnostics > Editor", "bindings": { "alt-6": "pane::CloseActiveItem" } },
{ "context": "OutlinePanel", "bindings": { "alt-7": "workspace::CloseActiveDock" } },
{
// `ctrl-alt-l` is bound to `editor::Format` (jetbrains "Reformat Code") in
// the Editor context above, which collides with the default
// `agent::OpenRulesLibrary` binding. Mirror the windows keymap and use
// `shift-alt-l` instead so the menu hint and the action stay in sync.
"context": "AgentPanel",
"bindings": {
"ctrl-alt-l": null,
"shift-alt-l": "agent::OpenRulesLibrary",
},
},
{
"context": "Dock || Workspace || OutlinePanel || ProjectPanel || CollabPanel",
"bindings": {
"escape": "editor::ToggleFocus",
"shift-escape": "workspace::CloseActiveDock",
},
},
{
"context": "Editor && mode == auto_height",
"bindings": {
"escape": "editor::Cancel",
},
},
{
"context": "CallHierarchyPicker > Picker > Editor",
"bindings": {
"ctrl-alt-h": "call_hierarchy::ToggleDirection",
"ctrl-k": null,
},
},
]
+233
View File
@@ -0,0 +1,233 @@
[
{
"bindings": {
"cmd-{": "pane::ActivatePreviousItem",
"cmd-}": "pane::ActivateNextItem",
"cmd-0": "git_panel::ToggleFocus", // overrides `cmd-0` zoom reset
"shift-escape": null, // Unmap workspace::zoom
"cmd-~": "git::Branch",
"ctrl-f2": "debugger::Stop",
"f6": "debugger::Pause",
"f7": "debugger::StepInto",
"f8": "debugger::StepOver",
"shift-f8": "debugger::StepOut",
"f9": "debugger::Continue",
"shift-f9": "debugger::Start",
"alt-shift-f9": "debugger::Start",
},
},
{
"context": "Editor",
"bindings": {
"ctrl->": ["zed::IncreaseBufferFontSize", { "persist": true }],
"ctrl-<": ["zed::DecreaseBufferFontSize", { "persist": true }],
"ctrl-shift-j": "editor::JoinLines",
"cmd-d": "editor::DuplicateSelection",
"cmd-backspace": "editor::DeleteLine",
"cmd-pagedown": "editor::MovePageDown",
"cmd-pageup": "editor::MovePageUp",
"ctrl-alt-shift-b": "editor::SelectToPreviousWordStart",
"cmd-alt-enter": "editor::NewlineAbove",
"shift-enter": "editor::NewlineBelow",
"cmd--": "editor::Fold",
"cmd-+": "editor::UnfoldLines",
"alt-shift-g": "editor::SplitSelectionIntoLines",
"ctrl-g": ["editor::SelectNext", { "replace_newest": false }],
"ctrl-shift-g": "editor::UndoSelection",
"ctrl-cmd-g": ["editor::SelectPrevious", { "replace_newest": false }],
"cmd-/": ["editor::ToggleComments", { "advance_downwards": true, "comment_empty_lines": true }],
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"shift-alt-up": "editor::MoveLineUp",
"shift-alt-down": "editor::MoveLineDown",
"cmd-alt-l": "editor::Format",
"ctrl-alt-o": "editor::OrganizeImports",
"shift-f6": "editor::Rename",
"cmd-[": "pane::GoBack",
"cmd-]": "pane::GoForward",
"alt-f7": "editor::FindAllReferences",
"cmd-alt-f7": "editor::FindAllReferences",
"cmd-b": "editor::GoToDefinition", // Conflicts with workspace::ToggleLeftDock
"cmd-alt-b": "editor::GoToImplementation",
"cmd-shift-b": "editor::GoToTypeDefinition",
"cmd-alt-shift-b": "editor::GoToTypeDefinitionSplit",
"f2": "editor::GoToDiagnostic",
"shift-f2": "editor::GoToPreviousDiagnostic",
"ctrl-alt-shift-down": "editor::GoToHunk",
"ctrl-alt-shift-up": "editor::GoToPreviousHunk",
"cmd-home": "editor::MoveToBeginning",
"cmd-end": "editor::MoveToEnd",
"cmd-shift-home": "editor::SelectToBeginning",
"cmd-shift-end": "editor::SelectToEnd",
"alt-left": "editor::MoveToPreviousSubwordStart",
"alt-right": "editor::MoveToNextSubwordEnd",
"shift-alt-left": "editor::SelectToPreviousSubwordStart",
"shift-alt-right": "editor::SelectToNextSubwordEnd",
"ctrl-f8": "editor::ToggleBreakpoint",
"ctrl-shift-f8": "editor::EditLogBreakpoint",
"cmd-shift-u": "editor::ToggleCase",
},
},
{
"context": "Editor && mode == full",
"bindings": {
"cmd-f12": "outline::Toggle",
"cmd-r": ["buffer_search::Deploy", { "replace_enabled": true }],
"cmd-l": "go_to_line::Toggle",
"cmd-e": "file_finder::Toggle",
"cmd-shift-o": "file_finder::Toggle",
"cmd-shift-n": "file_finder::Toggle",
"alt-enter": "editor::ToggleCodeActions",
"ctrl-space": "editor::ShowCompletions",
"cmd-j": "editor::Hover",
"cmd-p": "editor::ShowSignatureHelp",
"cmd-\\": "assistant::InlineAssist",
"ctrl-alt-h": "call_hierarchy::ShowIncomingCalls",
},
},
{
"context": "Editor && mode == auto_height",
"bindings": {
"shift-enter": "editor::Newline",
"ctrl-shift-enter": "editor::NewlineBelow",
},
},
{
"context": "BufferSearchBar && !in_replace > Editor",
"bindings": {
"shift-enter": "search::SelectPreviousMatch",
},
},
{
"context": "AcpThreadSearchBar > Editor",
"bindings": {
"shift-enter": "agent::SelectPreviousThreadMatch",
},
},
{
"context": "BufferSearchBar || ProjectSearchBar",
"bindings": {
"alt-c": "search::ToggleCaseSensitive",
"alt-e": "search::ToggleSelection",
"alt-x": "search::ToggleRegex",
"alt-w": "search::ToggleWholeWord",
"ctrl-alt-c": "search::ToggleCaseSensitive",
"ctrl-alt-e": "search::ToggleSelection",
"ctrl-alt-w": "search::ToggleWholeWord",
"ctrl-alt-x": "search::ToggleRegex",
},
},
{
"context": "Workspace",
"bindings": {
"cmd-shift-f12": "workspace::ToggleAllDocks",
"cmd-shift-r": ["pane::DeploySearch", { "replace_enabled": true }],
"ctrl-alt-r": "task::Spawn",
"shift-f10": "task::Spawn",
"cmd-f5": "task::Rerun",
"cmd-e": "file_finder::Toggle",
"cmd-k": "git_panel::ToggleFocus", // bug: This should also focus commit editor
"cmd-shift-o": "file_finder::Toggle",
"cmd-shift-n": "file_finder::Toggle",
"cmd-n": "project_symbols::Toggle",
"cmd-shift-a": "command_palette::Toggle",
"shift shift": "command_palette::Toggle",
"cmd-alt-o": "project_symbols::Toggle", // JetBrains: Go to Symbol
"cmd-o": "project_symbols::Toggle", // JetBrains: Go to Class
"cmd-1": "project_panel::ToggleFocus",
"cmd-5": "debug_panel::ToggleFocus",
"cmd-6": "diagnostics::Deploy",
"cmd-7": "outline_panel::ToggleFocus",
},
},
{
"context": "Pane", // this is to override the default Pane mappings to switch tabs
"bindings": {
"cmd-1": "project_panel::ToggleFocus",
"cmd-2": null, // Bookmarks (left dock)
"cmd-3": null, // Find Panel (bottom dock)
"cmd-4": null, // Run Panel (bottom dock)
"cmd-5": "debug_panel::ToggleFocus",
"cmd-6": "diagnostics::Deploy",
"cmd-7": "outline_panel::ToggleFocus",
"cmd-8": null, // Services (bottom dock)
"cmd-9": null, // Git History (bottom dock)
"cmd-0": "git_panel::ToggleFocus",
},
},
{
"context": "Workspace || Editor",
"bindings": {
"alt-f12": "terminal_panel::Toggle",
"cmd-shift-k": "git::Push",
},
},
{
"context": "Pane",
"bindings": {
"cmd-alt-left": "pane::GoBack",
"cmd-alt-right": "pane::GoForward",
"alt-left": "pane::ActivatePreviousItem",
"alt-right": "pane::ActivateNextItem",
},
},
{
"context": "ProjectPanel",
"bindings": {
"enter": "project_panel::Open",
"cmd-shift-f": "project_panel::NewSearchInDirectory",
"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",
},
},
{
"context": "Terminal",
"bindings": {
"cmd-t": "workspace::NewTerminal",
"alt-f12": "workspace::CloseActiveDock",
"cmd-up": "terminal::ScrollLineUp",
"cmd-down": "terminal::ScrollLineDown",
"shift-pageup": "terminal::ScrollPageUp",
"shift-pagedown": "terminal::ScrollPageDown",
},
},
{ "context": "GitPanel", "bindings": { "cmd-0": "workspace::CloseActiveDock" } },
{ "context": "ProjectPanel", "bindings": { "cmd-1": "workspace::CloseActiveDock" } },
{ "context": "DebugPanel", "bindings": { "cmd-5": "workspace::CloseActiveDock" } },
{ "context": "Diagnostics > Editor", "bindings": { "cmd-6": "pane::CloseActiveItem" } },
{ "context": "OutlinePanel", "bindings": { "cmd-7": "workspace::CloseActiveDock" } },
{
// `cmd-alt-l` is bound to `editor::Format` (jetbrains "Reformat Code") in
// the Editor context above, which collides with the default
// `agent::OpenRulesLibrary` binding. Mirror the windows keymap and use
// `shift-alt-l` instead so the menu hint and the action stay in sync.
"context": "AgentPanel",
"bindings": {
"cmd-alt-l": null,
"shift-alt-l": "agent::OpenRulesLibrary",
},
},
{
"context": "Dock || Workspace || OutlinePanel || ProjectPanel || CollabPanel",
"bindings": {
"escape": "editor::ToggleFocus",
"shift-escape": "workspace::CloseActiveDock",
},
},
{
"context": "Editor && mode == auto_height",
"bindings": {
"escape": "editor::Cancel",
},
},
{
"context": "CallHierarchyPicker > Picker > Editor",
"bindings": {
"ctrl-alt-h": "call_hierarchy::ToggleDirection",
"cmd-k": null,
},
},
]
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+71
View File
@@ -2596,6 +2596,12 @@ impl Terminal {
}
}
}
// Ctrl/cmd-click opens links in mouse mode when this is enabled, so
// hovering with the modifier held has to highlight them as well.
if TerminalSettings::get_global(cx).open_links_in_mouse_mode {
self.schedule_find_hyperlink(e.modifiers, e.position, cx);
}
} else {
self.schedule_find_hyperlink(e.modifiers, e.position, cx);
}
@@ -5507,6 +5513,71 @@ mod tests {
});
}
#[gpui::test]
async fn test_ctrl_hover_finds_hyperlink_in_mouse_mode(cx: &mut TestAppContext) {
let terminal = init_terminal_test(cx, b"Visit https://zed.dev/ for more\r\n");
terminal.update(cx, |terminal, cx| {
terminal.last_content.mode = Modes::MOUSE_REPORT_CLICK | Modes::MOUSE_MOTION;
terminal.mouse_move(
&MouseMoveEvent {
position: point(px(80.0), px(10.0)),
pressed_button: None,
modifiers: Modifiers::secondary_key(),
},
MouseInputMode::ReportToTerminal,
cx,
);
assert!(
any_event_matches!(terminal, InternalEvent::FindHyperlink(_, false)),
"ctrl+hover must look up the hyperlink under the pointer in mouse mode"
);
let pty_writes = terminal.take_pty_write_log();
assert_eq!(
pty_writes.len(),
1,
"the motion must still be reported to the app, got {pty_writes:?}"
);
});
}
#[gpui::test]
async fn test_ctrl_hover_in_mouse_mode_ignored_when_setting_disabled(
cx: &mut TestAppContext,
) {
let terminal = init_terminal_test(cx, b"Visit https://zed.dev/ for more\r\n");
cx.update_global(|store: &mut settings::SettingsStore, cx| {
store.update_user_settings(cx, |settings| {
settings
.terminal
.get_or_insert_default()
.open_links_in_mouse_mode = Some(false);
});
});
terminal.update(cx, |terminal, cx| {
terminal.last_content.mode = Modes::MOUSE_REPORT_CLICK | Modes::MOUSE_MOTION;
terminal.mouse_move(
&MouseMoveEvent {
position: point(px(80.0), px(10.0)),
pressed_button: None,
modifiers: Modifiers::secondary_key(),
},
MouseInputMode::ReportToTerminal,
cx,
);
assert!(
!any_event_matches!(terminal, InternalEvent::FindHyperlink(_, _)),
"with the setting disabled, ctrl+hover must not look up links in mouse mode"
);
});
}
#[gpui::test]
async fn test_hyperlink_ctrl_click_drag_outside_bounds(cx: &mut TestAppContext) {
let terminal = init_terminal_test(
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff