fix warnings

This commit is contained in:
Jan Hrastnik 2020-10-19 16:16:00 +02:00
parent bc2c652fe8
commit ae8ff9623e
3 changed files with 7 additions and 18 deletions

View file

@ -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

View file

@ -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

View file

@ -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);
}
_ => (),
}
}