mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Add back toggle sidebar key bindings
This commit is contained in:
parent
1e0182f6c7
commit
2ea2ba358f
2 changed files with 22 additions and 9 deletions
|
@ -53,7 +53,21 @@
|
|||
"cmd-t": "project_symbols::Toggle",
|
||||
"cmd-p": "file_finder::Toggle",
|
||||
"alt-shift-D": "diagnostics::Deploy",
|
||||
"ctrl-alt-cmd-j": "journal::NewJournalEntry"
|
||||
"ctrl-alt-cmd-j": "journal::NewJournalEntry",
|
||||
"cmd-1": [
|
||||
"workspace::ToggleSidebarItemFocus",
|
||||
{
|
||||
"side": "Left",
|
||||
"item_index": 0
|
||||
}
|
||||
],
|
||||
"cmd-shift-!": [
|
||||
"workspace::ToggleSidebarItem",
|
||||
{
|
||||
"side": "Left",
|
||||
"item_index": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"ProjectSearchBar": {
|
||||
"enter": "project_search::Search",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use super::Workspace;
|
||||
use gpui::{
|
||||
elements::*, impl_internal_actions, platform::CursorStyle, AnyViewHandle, RenderContext,
|
||||
};
|
||||
use gpui::{elements::*, impl_actions, platform::CursorStyle, AnyViewHandle, RenderContext};
|
||||
use serde::Deserialize;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use theme::Theme;
|
||||
|
||||
|
@ -12,7 +11,7 @@ pub struct Sidebar {
|
|||
width: Rc<RefCell<f32>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[derive(Clone, Copy, Deserialize)]
|
||||
pub enum Side {
|
||||
Left,
|
||||
Right,
|
||||
|
@ -23,15 +22,15 @@ struct Item {
|
|||
view: AnyViewHandle,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Deserialize)]
|
||||
pub struct ToggleSidebarItem(pub SidebarItemId);
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Deserialize)]
|
||||
pub struct ToggleSidebarItemFocus(pub SidebarItemId);
|
||||
|
||||
impl_internal_actions!(workspace, [ToggleSidebarItem, ToggleSidebarItemFocus]);
|
||||
impl_actions!(workspace, [ToggleSidebarItem, ToggleSidebarItemFocus]);
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Deserialize)]
|
||||
pub struct SidebarItemId {
|
||||
pub side: Side,
|
||||
pub item_index: usize,
|
||||
|
|
Loading…
Reference in a new issue