()
| 244 | } |
| 245 | |
| 246 | pub fn create_new_line_editor() -> LineEditor { |
| 247 | let prompt = StringPrompt::new("gitql > ".to_string()); |
| 248 | let mut line_editor = LineEditor::new(Box::new(prompt)); |
| 249 | |
| 250 | let mut style = Style::default(); |
| 251 | style.set_background_color(lineeditor::Color::Cyan); |
| 252 | line_editor.set_visual_selection_style(Some(style)); |
| 253 | |
| 254 | line_editor.add_highlighter(Box::<GitQLHighlighter>::default()); |
| 255 | line_editor.add_highlighter(Box::<MatchingBracketsHighlighter>::default()); |
| 256 | line_editor.add_hinter(Box::<GitQLHinter>::default()); |
| 257 | line_editor.set_completer(Box::new(FixedCompleter)); |
| 258 | |
| 259 | let bindings = line_editor.keybinding(); |
| 260 | bindings.register_common_control_bindings(); |
| 261 | bindings.register_common_navigation_bindings(); |
| 262 | bindings.register_common_edit_bindings(); |
| 263 | bindings.register_common_selection_bindings(); |
| 264 | bindings.register_binding( |
| 265 | KeyCombination { |
| 266 | key_kind: lineeditor::KeyEventKind::Press, |
| 267 | modifier: KeyModifiers::NONE, |
| 268 | key_code: lineeditor::KeyCode::Tab, |
| 269 | }, |
| 270 | LineEditorEvent::ToggleAutoComplete, |
| 271 | ); |
| 272 | |
| 273 | line_editor |
| 274 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…