-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an Iterator #82
Comments
And for ? |
In my code, I ignore it. It's handy if you want to discard the current line. |
Something like: impl<C: Completer> Iterator for Editor<C> {
type Item = Result<String>;
fn next(&mut self) -> Option<Result<String>> {
let readline = self.readline(""); // FIXME prompt
match readline {
l @ Ok(_) => Some(l),
Err(error::ReadlineError::Eof) => None,
e @ Err(_) => Some(e),
}
}
} ? |
Yeah, something like that. The prompt could be configured at creation time, since it tend to stay the same for most program. You should also keep the current interface, in case someone want to do something different |
SGTM. Just add an implementation for |
2.0 released |
We could do:
It would end on EOF or
The text was updated successfully, but these errors were encountered: