Move actions to namespaces used in zed1 keybinding settings
This commit is contained in:
parent
75324abbb5
commit
646b74e0a7
4 changed files with 20 additions and 10 deletions
1
crates/recent_projects2/src/projects.rs
Normal file
1
crates/recent_projects2/src/projects.rs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
gpui::actions!(OpenRecent);
|
|
@ -1,9 +1,10 @@
|
||||||
mod highlighted_workspace_location;
|
mod highlighted_workspace_location;
|
||||||
|
mod projects;
|
||||||
|
|
||||||
use fuzzy::{StringMatch, StringMatchCandidate};
|
use fuzzy::{StringMatch, StringMatchCandidate};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, Result, Task,
|
AppContext, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, Result, Task, View,
|
||||||
View, ViewContext, WeakView,
|
ViewContext, WeakView,
|
||||||
};
|
};
|
||||||
use highlighted_workspace_location::HighlightedWorkspaceLocation;
|
use highlighted_workspace_location::HighlightedWorkspaceLocation;
|
||||||
use ordered_float::OrderedFloat;
|
use ordered_float::OrderedFloat;
|
||||||
|
@ -16,7 +17,7 @@ use workspace::{
|
||||||
WORKSPACE_DB,
|
WORKSPACE_DB,
|
||||||
};
|
};
|
||||||
|
|
||||||
actions!(OpenRecent);
|
pub use projects::OpenRecent;
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
cx.observe_new_views(RecentProjects::register).detach();
|
cx.observe_new_views(RecentProjects::register).detach();
|
||||||
|
|
|
@ -50,7 +50,7 @@ use std::{
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
px, AnyWindowHandle, AppContext, Bounds, ClipboardItem, EventEmitter, Hsla, Keystroke,
|
actions, px, AnyWindowHandle, AppContext, Bounds, ClipboardItem, EventEmitter, Hsla, Keystroke,
|
||||||
ModelContext, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels,
|
ModelContext, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels,
|
||||||
Point, ScrollWheelEvent, Size, Task, TouchPhase,
|
Point, ScrollWheelEvent, Size, Task, TouchPhase,
|
||||||
};
|
};
|
||||||
|
@ -58,6 +58,16 @@ use gpui::{
|
||||||
use crate::mappings::{colors::to_alac_rgb, keys::to_esc_str};
|
use crate::mappings::{colors::to_alac_rgb, keys::to_esc_str};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
|
actions!(
|
||||||
|
Clear,
|
||||||
|
Copy,
|
||||||
|
Paste,
|
||||||
|
ShowCharacterPalette,
|
||||||
|
SearchTest,
|
||||||
|
SendText,
|
||||||
|
SendKeystroke,
|
||||||
|
);
|
||||||
|
|
||||||
///Scrolling is unbearably sluggish by default. Alacritty supports a configurable
|
///Scrolling is unbearably sluggish by default. Alacritty supports a configurable
|
||||||
///Scroll multiplier that is set to 3 by default. This will be removed when I
|
///Scroll multiplier that is set to 3 by default. This will be removed when I
|
||||||
///Implement scroll bars.
|
///Implement scroll bars.
|
||||||
|
|
|
@ -9,9 +9,9 @@ pub mod terminal_panel;
|
||||||
// use crate::terminal_element::TerminalElement;
|
// use crate::terminal_element::TerminalElement;
|
||||||
use editor::{scroll::autoscroll::Autoscroll, Editor};
|
use editor::{scroll::autoscroll::Autoscroll, Editor};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, div, Action, AnyElement, AppContext, Div, EventEmitter, FocusEvent, FocusHandle,
|
div, Action, AnyElement, AppContext, Div, EventEmitter, FocusEvent, FocusHandle, Focusable,
|
||||||
Focusable, FocusableElement, FocusableView, KeyContext, KeyDownEvent, Keystroke, Model,
|
FocusableElement, FocusableView, KeyContext, KeyDownEvent, Keystroke, Model, MouseButton,
|
||||||
MouseButton, MouseDownEvent, Pixels, Render, Subscription, Task, View, VisualContext, WeakView,
|
MouseDownEvent, Pixels, Render, Subscription, Task, View, VisualContext, WeakView,
|
||||||
};
|
};
|
||||||
use language::Bias;
|
use language::Bias;
|
||||||
use persistence::TERMINAL_DB;
|
use persistence::TERMINAL_DB;
|
||||||
|
@ -22,7 +22,7 @@ use terminal::{
|
||||||
term::{search::RegexSearch, TermMode},
|
term::{search::RegexSearch, TermMode},
|
||||||
},
|
},
|
||||||
terminal_settings::{TerminalBlink, TerminalSettings, WorkingDirectory},
|
terminal_settings::{TerminalBlink, TerminalSettings, WorkingDirectory},
|
||||||
Event, MaybeNavigationTarget, Terminal,
|
Clear, Copy, Event, MaybeNavigationTarget, Paste, ShowCharacterPalette, Terminal,
|
||||||
};
|
};
|
||||||
use terminal_element::TerminalElement;
|
use terminal_element::TerminalElement;
|
||||||
use ui::{h_stack, prelude::*, ContextMenu, Icon, IconElement, Label};
|
use ui::{h_stack, prelude::*, ContextMenu, Icon, IconElement, Label};
|
||||||
|
@ -60,8 +60,6 @@ pub struct SendText(String);
|
||||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Action)]
|
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Action)]
|
||||||
pub struct SendKeystroke(String);
|
pub struct SendKeystroke(String);
|
||||||
|
|
||||||
actions!(Clear, Copy, Paste, ShowCharacterPalette, SearchTest);
|
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
terminal_panel::init(cx);
|
terminal_panel::init(cx);
|
||||||
terminal::init(cx);
|
terminal::init(cx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue