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-t": "project_symbols::Toggle",
|
||||||
"cmd-p": "file_finder::Toggle",
|
"cmd-p": "file_finder::Toggle",
|
||||||
"alt-shift-D": "diagnostics::Deploy",
|
"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": {
|
"ProjectSearchBar": {
|
||||||
"enter": "project_search::Search",
|
"enter": "project_search::Search",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use super::Workspace;
|
use super::Workspace;
|
||||||
use gpui::{
|
use gpui::{elements::*, impl_actions, platform::CursorStyle, AnyViewHandle, RenderContext};
|
||||||
elements::*, impl_internal_actions, platform::CursorStyle, AnyViewHandle, RenderContext,
|
use serde::Deserialize;
|
||||||
};
|
|
||||||
use std::{cell::RefCell, rc::Rc};
|
use std::{cell::RefCell, rc::Rc};
|
||||||
use theme::Theme;
|
use theme::Theme;
|
||||||
|
|
||||||
|
@ -12,7 +11,7 @@ pub struct Sidebar {
|
||||||
width: Rc<RefCell<f32>>,
|
width: Rc<RefCell<f32>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy, Deserialize)]
|
||||||
pub enum Side {
|
pub enum Side {
|
||||||
Left,
|
Left,
|
||||||
Right,
|
Right,
|
||||||
|
@ -23,15 +22,15 @@ struct Item {
|
||||||
view: AnyViewHandle,
|
view: AnyViewHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Deserialize)]
|
||||||
pub struct ToggleSidebarItem(pub SidebarItemId);
|
pub struct ToggleSidebarItem(pub SidebarItemId);
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Deserialize)]
|
||||||
pub struct ToggleSidebarItemFocus(pub SidebarItemId);
|
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 struct SidebarItemId {
|
||||||
pub side: Side,
|
pub side: Side,
|
||||||
pub item_index: usize,
|
pub item_index: usize,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue