summaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/commands.rs15
-rw-r--r--helix-view/src/keymap.rs1
-rw-r--r--helix-view/src/prompt.rs9
3 files changed, 7 insertions, 18 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs
index 33fc06e4..905f4e10 100644
--- a/helix-view/src/commands.rs
+++ b/helix-view/src/commands.rs
@@ -307,21 +307,6 @@ pub fn append_mode(view: &mut View, _count: usize) {
})
}
-pub fn command_mode(_view: &mut View, _count: usize) {
- use crate::Editor;
-
- let prompt = Prompt::new(
- ":".to_owned(),
- |_input: &str| None, // completion
- |editor: &mut Editor, input: &str| match input {
- "q" => editor.should_close = true,
- _ => (),
- },
- );
-
- // set_prompt(prompt)
-}
-
// TODO: I, A, o and O can share a lot of the primitives.
// calculate line numbers for each selection range
diff --git a/helix-view/src/keymap.rs b/helix-view/src/keymap.rs
index 69e6cabb..f70b9deb 100644
--- a/helix-view/src/keymap.rs
+++ b/helix-view/src/keymap.rs
@@ -163,7 +163,6 @@ pub fn default() -> Keymaps {
vec![key!('p')] => commands::paste,
vec![key!('>')] => commands::indent,
vec![key!('<')] => commands::unindent,
- vec![key!(':')] => commands::command_mode,
vec![Key {
code: KeyCode::Esc,
modifiers: Modifiers::NONE
diff --git a/helix-view/src/prompt.rs b/helix-view/src/prompt.rs
index a3feaeec..729533c5 100644
--- a/helix-view/src/prompt.rs
+++ b/helix-view/src/prompt.rs
@@ -1,5 +1,4 @@
-use crate::commands;
-use crate::{Editor, View};
+use crate::Editor;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use std::string::String;
@@ -91,6 +90,12 @@ impl Prompt {
code: KeyCode::Enter,
..
} => (self.callback_fn)(editor, &self.line),
+ KeyEvent {
+ code: KeyCode::Tab, ..
+ } => {
+ let _completion = (self.completion_fn)(&self.line);
+ }
+
_ => (),
}
}