Restructure action macro to assign a namespace to every action
Also, allow arbitrary types to be used as Actions via the impl_actions macro Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
parent
206b0f0f8c
commit
5242a3a6dc
33 changed files with 432 additions and 306 deletions
|
@ -7,13 +7,16 @@ mod vim_test_context;
|
|||
|
||||
use collections::HashMap;
|
||||
use editor::{CursorShape, Editor};
|
||||
use gpui::{action, MutableAppContext, ViewContext, WeakViewHandle};
|
||||
use gpui::{impl_actions, MutableAppContext, ViewContext, WeakViewHandle};
|
||||
|
||||
use mode::Mode;
|
||||
use settings::Settings;
|
||||
use workspace::{self, Workspace};
|
||||
|
||||
action!(SwitchMode, Mode);
|
||||
#[derive(Clone)]
|
||||
pub struct SwitchMode(pub Mode);
|
||||
|
||||
impl_actions!(vim, [SwitchMode]);
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
editor_events::init(cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue