Clear out easy todo!()s

This commit is contained in:
Conrad Irwin 2023-12-11 11:00:55 -07:00
parent dd42adc4e5
commit 8ed642dc16
6 changed files with 26 additions and 30 deletions

View file

@ -167,8 +167,7 @@ pub fn command_interceptor(mut query: &str, _: &AppContext) -> Option<CommandInt
.boxed_clone(), .boxed_clone(),
), ),
"cq" | "cqu" | "cqui" | "cquit" | "cq!" | "cqu!" | "cqui!" | "cquit!" => { "cq" | "cqu" | "cqui" | "cquit" | "cq!" | "cqu!" | "cqui!" | "cquit!" => {
// ("cquit!", zed_actions::Quit.boxed_clone()) ("cquit!", zed_actions::Quit.boxed_clone())
todo!(); // Quit is no longer in zed actions :/
} }
// pane management // pane management

View file

@ -29,12 +29,6 @@ fn focused(editor: View<Editor>, cx: &mut WindowContext) {
Vim::update(cx, |vim, cx| { Vim::update(cx, |vim, cx| {
vim.set_active_editor(editor.clone(), cx); vim.set_active_editor(editor.clone(), cx);
if vim.enabled {
// todo!()
// cx.emit_global(VimEvent::ModeChanged {
// mode: vim.state().mode,
// });
}
}); });
} }

View file

@ -326,9 +326,6 @@ impl Vim {
self.take_count(cx); self.take_count(cx);
} }
// todo!()
// cx.emit_global(VimEvent::ModeChanged { mode });
// Sync editor settings like clip mode // Sync editor settings like clip mode
self.sync_vim_settings(cx); self.sync_vim_settings(cx);
@ -495,21 +492,24 @@ impl Vim {
let _ = cx.remove_global::<CommandPaletteInterceptor>(); let _ = cx.remove_global::<CommandPaletteInterceptor>();
} }
// todo!(); if let Some(active_window) = cx.active_window() {
// cx.update_active_window(|cx| { active_window
// if self.enabled { .update(cx, |root_view, cx| {
// let active_editor = cx if self.enabled {
// .root_view() let active_editor = root_view
// .downcast_ref::<Workspace>() .downcast::<Workspace>()
// .and_then(|workspace| workspace.read(cx).active_item(cx)) .ok()
// .and_then(|item| item.downcast::<Editor>()); .and_then(|workspace| workspace.read(cx).active_item(cx))
// if let Some(active_editor) = active_editor { .and_then(|item| item.downcast::<Editor>());
// self.set_active_editor(active_editor, cx); if let Some(active_editor) = active_editor {
// } self.set_active_editor(active_editor, cx);
// self.switch_mode(Mode::Normal, false, cx); }
// } self.switch_mode(Mode::Normal, false, cx);
// self.sync_vim_settings(cx); }
// }); self.sync_vim_settings(cx);
})
.ok();
}
} }
} }

View file

@ -2,6 +2,8 @@ use gpui::{Menu, MenuItem, OsAction};
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub fn app_menus() -> Vec<Menu<'static>> { pub fn app_menus() -> Vec<Menu<'static>> {
use zed_actions::Quit;
vec![ vec![
Menu { Menu {
name: "Zed", name: "Zed",
@ -25,7 +27,7 @@ pub fn app_menus() -> Vec<Menu<'static>> {
MenuItem::action("Hide Zed", super::Hide), MenuItem::action("Hide Zed", super::Hide),
MenuItem::action("Hide Others", super::HideOthers), MenuItem::action("Hide Others", super::HideOthers),
MenuItem::action("Show All", super::ShowAll), MenuItem::action("Show All", super::ShowAll),
MenuItem::action("Quit", super::Quit), MenuItem::action("Quit", Quit),
], ],
}, },
Menu { Menu {

View file

@ -41,7 +41,7 @@ use workspace::{
notifications::simple_message_notification::MessageNotification, open_new, AppState, NewFile, notifications::simple_message_notification::MessageNotification, open_new, AppState, NewFile,
NewWindow, Workspace, WorkspaceSettings, NewWindow, Workspace, WorkspaceSettings,
}; };
use zed_actions::{OpenBrowser, OpenZedURL}; use zed_actions::{OpenBrowser, OpenZedURL, Quit};
actions!( actions!(
zed, zed,
@ -61,7 +61,6 @@ actions!(
OpenLog, OpenLog,
OpenSettings, OpenSettings,
OpenTelemetryLog, OpenTelemetryLog,
Quit,
ResetBufferFontSize, ResetBufferFontSize,
ResetDatabase, ResetDatabase,
ShowAll, ShowAll,

View file

@ -1,4 +1,4 @@
use gpui::impl_actions; use gpui::{actions, impl_actions};
use serde::Deserialize; use serde::Deserialize;
// If the zed binary doesn't use anything in this crate, it will be optimized away // If the zed binary doesn't use anything in this crate, it will be optimized away
@ -21,3 +21,5 @@ pub struct OpenZedURL {
} }
impl_actions!(zed, [OpenBrowser, OpenZedURL]); impl_actions!(zed, [OpenBrowser, OpenZedURL]);
actions!(zed, [Quit]);