MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / create_new_line_editor

Function create_new_line_editor

src/gitql/gitql_line_editor.rs:246–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

244}
245
246pub 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}

Callers 1

launch_gitql_replFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…