Skip to content
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

Mapping between linenoise API and rustyline API #737

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions linenoise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Mapping between linenoise API and rustyline API

| linenoise | rustyline | Remarks |
|--------------------------------|------------------------------|---------------------------|
| linenoiseState | State | |
| *Blocking API* |
| linenoise | Editor::readline |
| linenoiseFree | _ | RAII |
| *Non blocking API* | |
| linenoiseEditStart | _ |
| linenoiseEditFeed | _ |
| linenoiseEditStop | _ |
| linenoiseHide | Renderer::clear_rows |
| linenoiseShow | State::refresh_line |
| *Completion API* |
| linenoiseCompletions | Vec<Candidate> |
| linenoiseCompletionCallback | Completer |
| linenoiseAddCompletion | _ | std Vec::add |
| linenoiseSetCompletionCallback | Editor::set_helper |
| linenoiseHintsCallback | Hinter |
| linenoiseSetHintsCallback | Editor::set_helper |
| linenoiseFreeHintsCallback | _ | RAII |
| linenoiseSetFreeHintsCallback | _ | RAII |
| *History API* |
| linenoiseHistoryAdd | Editor::add_history_entry |
| linenoiseHistorySetMaxLen | Editor::set_max_history_size |
| linenoiseHistorySave | Editor::save_history |
| linenoiseHistoryLoad | Editor::load_history |
| *Other utilities* |
| linenoiseClearScreen | Editor::clear_screen |
| linenoiseSetMultiLine | _ | Always activated |
| linenoisePrintKeyCodes | _ | debug logs |
| linenoiseMaskModeEnable | _ | see read_password example |
| linenoiseMaskModeDisable | _ |
3 changes: 2 additions & 1 deletion src/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ pub trait Highlighter {
}
/// Tells if `line` needs to be highlighted when a specific char is typed or
/// when cursor is moved under a specific char.
/// `forced` flag is `true` mainly when user presses Enter (i.e. transient vs final highlight).
/// `forced` flag is `true` mainly when user presses Enter (i.e. transient
/// vs final highlight).
///
/// Used to optimize refresh when a character is inserted or the cursor is
/// moved.
Expand Down