1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-07 21:56:04 +02:00

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 @@ pub fn handle_input(&mut self, key_event: KeyEvent, editor: &mut Editor) {
code: KeyCode::Enter,
..
} => (self.callback_fn)(editor, &self.line),
KeyEvent {
code: KeyCode::Tab, ..
} => {
let _completion = (self.completion_fn)(&self.line);
}
_ => (),
}
}