mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Merge pull request #1352 from zed-industries/modal-context
Fixed modal terminal bindings to not show in command palette
This commit is contained in:
commit
66cd4b3d91
3 changed files with 10 additions and 3 deletions
|
@ -409,7 +409,6 @@
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"ctrl-c": "terminal::Sigint",
|
"ctrl-c": "terminal::Sigint",
|
||||||
"escape": "terminal::Escape",
|
"escape": "terminal::Escape",
|
||||||
"shift-escape": "terminal::DeployModal",
|
|
||||||
"ctrl-d": "terminal::Quit",
|
"ctrl-d": "terminal::Quit",
|
||||||
"backspace": "terminal::Del",
|
"backspace": "terminal::Del",
|
||||||
"enter": "terminal::Return",
|
"enter": "terminal::Return",
|
||||||
|
@ -422,5 +421,11 @@
|
||||||
"cmd-c": "terminal::Copy",
|
"cmd-c": "terminal::Copy",
|
||||||
"ctrl-l": "terminal::Clear"
|
"ctrl-l": "terminal::Clear"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "ModalTerminal",
|
||||||
|
"bindings": {
|
||||||
|
"shift-escape": "terminal::DeployModal"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
|
@ -16,8 +16,11 @@ pub fn deploy_modal(workspace: &mut Workspace, _: &DeployModal, cx: &mut ViewCon
|
||||||
if let Some(StoredConnection(stored_connection)) = possible_connection {
|
if let Some(StoredConnection(stored_connection)) = possible_connection {
|
||||||
// Create a view from the stored connection
|
// Create a view from the stored connection
|
||||||
workspace.toggle_modal(cx, |_, cx| {
|
workspace.toggle_modal(cx, |_, cx| {
|
||||||
cx.add_view(|cx| Terminal::from_connection(stored_connection, true, cx))
|
cx.add_view(|cx| Terminal::from_connection(stored_connection.clone(), true, cx))
|
||||||
});
|
});
|
||||||
|
cx.set_global::<Option<StoredConnection>>(Some(StoredConnection(
|
||||||
|
stored_connection.clone(),
|
||||||
|
)));
|
||||||
} else {
|
} else {
|
||||||
// No connection was stored, create a new terminal
|
// No connection was stored, create a new terminal
|
||||||
if let Some(closed_terminal_handle) = workspace.toggle_modal(cx, |workspace, cx| {
|
if let Some(closed_terminal_handle) = workspace.toggle_modal(cx, |workspace, cx| {
|
||||||
|
|
1
styles/package-lock.json
generated
1
styles/package-lock.json
generated
|
@ -5,7 +5,6 @@
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "styles",
|
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in a new issue