mirror of https://github.com/helix-editor/helix
fix warnings
parent
bc2c652fe8
commit
ae8ff9623e
|
@ -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.
|
// TODO: I, A, o and O can share a lot of the primitives.
|
||||||
|
|
||||||
// calculate line numbers for each selection range
|
// calculate line numbers for each selection range
|
||||||
|
|
|
@ -163,7 +163,6 @@ pub fn default() -> Keymaps {
|
||||||
vec![key!('p')] => commands::paste,
|
vec![key!('p')] => commands::paste,
|
||||||
vec![key!('>')] => commands::indent,
|
vec![key!('>')] => commands::indent,
|
||||||
vec![key!('<')] => commands::unindent,
|
vec![key!('<')] => commands::unindent,
|
||||||
vec![key!(':')] => commands::command_mode,
|
|
||||||
vec![Key {
|
vec![Key {
|
||||||
code: KeyCode::Esc,
|
code: KeyCode::Esc,
|
||||||
modifiers: Modifiers::NONE
|
modifiers: Modifiers::NONE
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::commands;
|
use crate::Editor;
|
||||||
use crate::{Editor, View};
|
|
||||||
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
|
||||||
use std::string::String;
|
use std::string::String;
|
||||||
|
|
||||||
|
@ -91,6 +90,12 @@ impl Prompt {
|
||||||
code: KeyCode::Enter,
|
code: KeyCode::Enter,
|
||||||
..
|
..
|
||||||
} => (self.callback_fn)(editor, &self.line),
|
} => (self.callback_fn)(editor, &self.line),
|
||||||
|
KeyEvent {
|
||||||
|
code: KeyCode::Tab, ..
|
||||||
|
} => {
|
||||||
|
let _completion = (self.completion_fn)(&self.line);
|
||||||
|
}
|
||||||
|
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue