@@ -28,7 +28,6 @@ use helix_lsp::lsp;
2828pub struct Context<'a> {
2929 pub count: usize,
3030 pub editor: &'a mut Editor,
31− pub executor: &'static smol::Executor<'static>,
3231
3332 pub callback: Option<crate::compositor::Callback>,
3433 pub on_next_key_callback: Option<Box<dyn FnOnce(&mut Context, KeyEvent)>>,
@@ -658,7 +657,6 @@ const COMMAND_LIST: &[&str] = &["write", "open", "quit"];
658657
659658// TODO: I, A, o and O can share a lot of the primitives.
660659pub fn command_mode(cx: &mut Context) {
661− let executor = cx.executor;
662660 let prompt = Prompt::new(
663661 ":".to_owned(),
664662 |input: &str| {
@@ -695,11 +693,11 @@ pub fn command_mode(cx: &mut Context) {
695693
696694 match *parts.as_slice() {
697695 ["q"] | ["quit"] => {
698− editor.close(editor.view().id, executor);
696+ editor.close(editor.view().id);
699697 // editor.should_close = true,
700698 }
701699 ["o", path] | ["open", path] => {
702− editor.open(path.into(), executor);
700+ editor.open(path.into());
703701 }
704702 ["w"] | ["write"] => {
705703 // TODO: non-blocking via save() command
@@ -713,7 +711,7 @@ pub fn command_mode(cx: &mut Context) {
713711 cx.push_layer(Box::new(prompt));
714712}
715713pub fn file_picker(cx: &mut Context) {
716− let picker = ui::file_picker("./", cx.executor);
714+ let picker = ui::file_picker("./");
717715 cx.push_layer(Box::new(picker));
718716}
719717
@@ -851,15 +849,13 @@ pub fn exit_select_mode(cx: &mut Context) {
851849}
852850
853851fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
854− let executor = cx.executor;
855852 let doc = cx.doc();
856853
857854 doc.mode = Mode::Normal;
858855
859856 match locations.as_slice() {
860857 [location] => {
861− cx.editor
862− .open(PathBuf::from(location.uri.path()), cx.executor);
858+ cx.editor.open(PathBuf::from(location.uri.path()));
863859 let doc = cx.doc();
864860 let definition_pos = location.range.start;
865861 let new_pos = helix_lsp::util::lsp_pos_to_pos(doc.text().slice(..), definition_pos);
@@ -875,7 +871,7 @@ fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
875871 format!("{}:{}", file, line).into()
876872 },
877873 move |editor: &mut Editor, item| {
878− editor.open(PathBuf::from(item.uri.path()), &executor);
874+ editor.open(PathBuf::from(item.uri.path()));
879875 let mut doc = &mut editor.view_mut().doc;
880876 let definition_pos = item.range.start;
881877 let new_pos =
@@ -1274,7 +1270,7 @@ pub fn save(cx: &mut Context) {
12741270 // Spawns an async task to actually do the saving. This way we prevent blocking.
12751271
12761272 // TODO: handle save errors somehow?
1277− cx.executor.spawn(cx.doc().save()).detach();
1273+ cx.editor.executor.spawn(cx.doc().save()).detach();
12781274}
12791275
12801276pub fn completion(cx: &mut Context) {