-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
A-CompletionsArea: Tab completion and inline hint completionsArea: Tab completion and inline hint completionsA-KeybindingEmacsArea: Handling of default (Emacs style) keybindingsArea: Handling of default (Emacs style) keybindingsdocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
Platform linux
Terminal software rxvt-unicode
The example completions program compiles, runs, and displays a prompt. Typing a few characters then TAB or Ctrl+X does not complete the expected word or display a menu of possible completions. It appears to have the same behavior as without calling with_completions.
Steps to reproduce
[dependencies]
reedline = { git = "https://github.com/nushell/reedline", branch = "main" }I did this today so I believe it's 8c565e4 though I don't know how to confirm this in the project.
use reedline::{DefaultCompleter, DefaultPrompt, Reedline, Signal};
fn main() {
let prompt = DefaultPrompt::default();
let commands = vec![
"test".into(),
"hello world".into(),
"hello world reedline".into(),
"this is the reedline crate".into(),
];
let completer = Box::new(DefaultCompleter::new_with_wordlen(commands, 2));
let mut line_editor = Reedline::create().unwrap().with_completer(completer);
loop {
let sig = line_editor.read_line(&prompt).unwrap();
match sig {
Signal::Success(buffer) => {
println!("We processed: {}", buffer);
}
Signal::CtrlD | Signal::CtrlC => {
println!("\nAborted!");
break;
}
Signal::CtrlL => {
line_editor.clear_screen().unwrap();
}
}
}
}Metadata
Metadata
Assignees
Labels
A-CompletionsArea: Tab completion and inline hint completionsArea: Tab completion and inline hint completionsA-KeybindingEmacsArea: Handling of default (Emacs style) keybindingsArea: Handling of default (Emacs style) keybindingsdocumentationImprovements or additions to documentationImprovements or additions to documentation