@@ -1,14 +1,14 @@
1−use clap::ArgMatches as Args;
2−use helix_core::{indent::TAB_WIDTH, syntax::HighlightEvent, Position, Range, State};
3−use helix_view::{
1+use crate::{
42 commands,
5− document::Mode,
63 keymap::{self, Keymaps},
7− prompt::Prompt,
8− Document, Editor, Theme, View,
94};
5+use clap::ArgMatches as Args;
6+use helix_core::{indent::TAB_WIDTH, syntax::HighlightEvent, Position, Range, State};
7+
8+use helix_view::{document::Mode, Document, Editor, Theme, View};
109
1110use crate::compositor::{Component, Compositor, EventResult};
11+use crate::prompt::Prompt;
1212
1313use log::{debug, info};
1414
@@ -395,23 +395,16 @@ impl Component for EditorView {
395395 EventResult::Consumed(None)
396396 }
397397 Event::Key(event) => {
398− // if there's a prompt, it takes priority
399− if let Some(prompt) = &mut self.prompt {
400− self.prompt
401− .as_mut()
402− .unwrap()
403− .handle_input(event, &mut self.editor);
404− EventResult::Consumed(None)
405− } else if let Some(view) = self.editor.view_mut() {
398+ if let Some(view) = self.editor.view_mut() {
406399 let keys = vec![event];
407400 // TODO: sequences (`gg`)
408401 // TODO: handle count other than 1
409402 match view.doc.mode() {
410403 Mode::Insert => {
411404 if let Some(command) = self.keymap[&Mode::Insert].get(&keys) {
412− let mut cx = helix_view::commands::Context {
405+ let mut cx = commands::Context {
413406 view,
414− executor: executor,
407+ executor,
415408 count: 1,
416409 };
417410
@@ -421,9 +414,9 @@ impl Component for EditorView {
421414 ..
422415 } = event
423416 {
424− let mut cx = helix_view::commands::Context {
417+ let mut cx = commands::Context {
425418 view,
426− executor: executor,
419+ executor,
427420 count: 1,
428421 };
429422 commands::insert::insert_char(&mut cx, c);
@@ -488,9 +481,9 @@ impl Component for EditorView {
488481
489482 // HAXX: special casing for command mode
490483 } else if let Some(command) = self.keymap[&Mode::Normal].get(&keys) {
491− let mut cx = helix_view::commands::Context {
484+ let mut cx = commands::Context {
492485 view,
493− executor: executor,
486+ executor,
494487 count: 1,
495488 };
496489 command(&mut cx);
@@ -501,9 +494,9 @@ impl Component for EditorView {
501494 }
502495 mode => {
503496 if let Some(command) = self.keymap[&mode].get(&keys) {
504− let mut cx = helix_view::commands::Context {
497+ let mut cx = commands::Context {
505498 view,
506− executor: executor,
499+ executor,
507500 count: 1,
508501 };
509502 command(&mut cx);
@@ -530,13 +523,6 @@ impl Component for EditorView {
530523 let theme_ref = unsafe { &*(&self.editor.theme as *const Theme) };
531524 if let Some(view) = self.editor.view_mut() {
532525 renderer.render_view(view, viewport, theme_ref);
533− if let Some(prompt) = &self.prompt {
534− if prompt.should_close {
535− self.prompt = None;
536− } else {
537− renderer.render_prompt(view, prompt, theme_ref);
538− }
539− }
540526 }
541527
542528 // TODO: drop unwrap
@@ -562,7 +548,6 @@ impl<'a> Application<'a> {
562548 renderer,
563549 // TODO; move to state
564550 compositor,
565− prompt: None,
566551
567552 executor,
568553 language_server,