Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-rust-mirrors-rustyline
Commits
701ca536
Commit
701ca536
authored
6 years ago
by
gwenn
Browse files
Options
Downloads
Patches
Plain Diff
Update docs
parent
73c838ab
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+15
-15
15 additions, 15 deletions
README.md
TODO.md
+4
-0
4 additions, 0 deletions
TODO.md
src/lib.rs
+3
-0
3 additions, 0 deletions
src/lib.rs
with
22 additions
and
15 deletions
README.md
+
15
−
15
View file @
701ca536
...
...
@@ -27,14 +27,14 @@ use rustyline::Editor;
fn
main
()
{
// `()` can be used when no completer is required
let
mut
rl
=
Editor
::
<
()
>
::
new
();
if
let
Err
(
_
)
=
rl
.load_history
(
"history.txt"
)
{
if
rl
.load_history
(
"history.txt"
)
.is_err
()
{
println!
(
"No previous history."
);
}
loop
{
let
readline
=
rl
.readline
(
">> "
);
match
readline
{
Ok
(
line
)
=>
{
rl
.add_history_entry
(
&
line
);
rl
.add_history_entry
(
line
.as_ref
()
);
println!
(
"Line: {}"
,
line
);
},
Err
(
ReadlineError
::
Interrupted
)
=>
{
...
...
@@ -73,7 +73,7 @@ rustyline = "1.0.0"
-
Kill ring (
[
Killing Commands
](
http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#IDX3
)
)
-
Multi line mode (line wrapping)
-
Word commands
-
Hints
(WIP: only on unix)
-
Hints
## Actions
...
...
@@ -94,7 +94,6 @@ Ctrl-T | Transpose previous character with current character
Ctrl-U | Delete from start of line to cursor
Ctrl-V | Insert any special character without perfoming its associated action (#65)
Ctrl-W | Delete word leading up to cursor (using white space as a word boundary)
Ctrl-X Ctrl-U | Undo
Ctrl-Y | Paste from Yank buffer
Ctrl-Z | Suspend (unix only)
Ctrl-_ | Undo
...
...
@@ -113,6 +112,7 @@ Ctrl-K | Delete from cursor to end of line
Ctrl-L | Clear screen
Ctrl-N, Down | Next match from history
Ctrl-P, Up | Previous match from history
Ctrl-X Ctrl-U | Undo
Ctrl-Y | Paste from Yank buffer (Meta-Y to paste next yank instead)
Meta-< | Move to first entry in history
Meta-> | Move to last entry in history
...
...
@@ -205,17 +205,17 @@ $ bind -p
## Similar projects
Library | Lang | OS | Term | Unicode | History | Completion | Keymap | Kill Ring | Undo | Colors |
-------- | ---- | -- | ---- | ------- | ------- | ---------- | ------- | --------- | ---- | ------ |
[
Haskeline
][]
| Haskell | Ux/Win | Any | Yes | Yes | any | Emacs/Vi/conf | Yes | Yes | ? |
[
Linenoise
][]
| C | Ux | ANSI | No | Yes | only line | Emacs | No | No | Ux |
[
Linenoise-ng
][]
| C | Ux/Win | ANSI | Yes | Yes | only line | Emacs | Yes | No | ? |
[
Linefeed
][]
| Rust | Ux/Win | Any | | Yes | any | Emacs/conf | Yes | No | ? |
[
Liner
][]
| Rust | Ux | ANSI | | No inc search | only word | Emacs/Vi
| No | Yes | Ux |
[
Prompt-toolkit
][]
| Python | Ux/Win | ANSI | Yes | Yes | any | Emacs/Vi/conf | Yes | Yes | Ux/Win |
[
Rb-readline
][]
| Ruby | Ux/Win | ANSI | Yes | Yes | only word | Emacs/Vi/conf | Yes | Yes | ? |
[
Replxx
][]
| C/C++ | Ux/Win | ANSI | Yes | Yes | only line | Emacs | Yes | No | Ux/Win |
Rustyline | Rust | Ux/Win | ANSI | Yes | Yes | any | Emacs/Vi/bind | Yes | Yes | Ux/Win 10+ |
Library | Lang | OS | Term | Unicode | History | Completion | Keymap | Kill Ring | Undo | Colors |
Hint/Auto suggest |
-------- | ---- | -- | ---- | ------- | ------- | ---------- | ------- | --------- | ---- | ------ |
----------------- |
[
Haskeline
][]
| Haskell | Ux/Win | Any | Yes | Yes | any | Emacs/Vi/conf | Yes | Yes | ? |
? |
[
Linenoise
][]
| C | Ux | ANSI | No | Yes | only line | Emacs | No | No | Ux |
Yes |
[
Linenoise-ng
][]
| C | Ux/Win | ANSI | Yes | Yes | only line | Emacs | Yes | No | ? |
? |
[
Linefeed
][]
| Rust | Ux/Win | Any | | Yes | any | Emacs/conf | Yes | No | ? |
No |
[
Liner
][]
| Rust | Ux | ANSI | | No inc search | only word | Emacs/Vi
/prog
| No | Yes | Ux |
History based |
[
Prompt-toolkit
][]
| Python | Ux/Win | ANSI | Yes | Yes | any | Emacs/Vi/conf | Yes | Yes | Ux/Win |
Yes |
[
Rb-readline
][]
| Ruby | Ux/Win | ANSI | Yes | Yes | only word | Emacs/Vi/conf | Yes | Yes | ? |
No |
[
Replxx
][]
| C/C++ | Ux/Win | ANSI | Yes | Yes | only line | Emacs | Yes | No | Ux/Win |
Yes |
Rustyline | Rust | Ux/Win | ANSI | Yes | Yes | any | Emacs/Vi/bind | Yes | Yes | Ux/Win 10+ |
Yes |
[
Haskeline
]:
https://github.com/judah/haskeline
[
Linefeed
]:
https://github.com/murarth/linefeed
...
...
This diff is collapsed.
Click to expand it.
TODO.md
+
4
−
0
View file @
701ca536
...
...
@@ -58,6 +58,10 @@ Repeat
-
[x] dynamic prompt (arg: ?)
-
[ ] transpose chars
Syntax
-
[ ] syntax specific tokenizer/parser
-
[ ] highlighting
Undo
-
[ ] Merge consecutive Replace
-
[X] Undo group
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
3
−
0
View file @
701ca536
...
...
@@ -606,6 +606,9 @@ fn readline_direct() -> Result<String> {
}
}
/// Syntax specific helper.
///
/// TODO Tokenizer/parser used for both completion, suggestion, highlighting
pub
trait
Helper
{
type
Completer
:
Completer
;
type
Hinter
:
Hinter
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment