Skip to content

Commit

Permalink
Merge pull request #737 from gwenn/linenoise
Browse files Browse the repository at this point in the history
Mapping between linenoise API and rustyline API
  • Loading branch information
gwenn authored Oct 8, 2023
2 parents f3adec4 + b66e92f commit ebbd5c1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
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

0 comments on commit ebbd5c1

Please sign in to comment.