Add command palette filter global and update it when vim mode is enabled/disabled

This commit is contained in:
Keith Simmons 2022-06-28 13:35:43 -07:00
parent 431d71fe92
commit f6292437fa
6 changed files with 39 additions and 6 deletions

View file

@ -2,6 +2,7 @@ use std::any::{Any, TypeId};
pub trait Action: 'static {
fn id(&self) -> TypeId;
fn namespace(&self) -> &'static str;
fn name(&self) -> &'static str;
fn as_any(&self) -> &dyn Any;
fn boxed_clone(&self) -> Box<dyn Action>;
@ -80,6 +81,10 @@ macro_rules! impl_internal_actions {
macro_rules! __impl_action {
($namespace:path, $name:ident, $from_json_fn:item) => {
impl $crate::action::Action for $name {
fn namespace(&self) -> &'static str {
stringify!($namespace)
}
fn name(&self) -> &'static str {
stringify!($name)
}