Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
413 commits
Select commit Hold shift + click to select a range
7fe1925
Merge pull request #412 from gwenn/escape_history_fix
gwenn Jul 6, 2020
14b3b83
Flexible AcceptLine, fix bug in multi-line accept
tailhook May 8, 2020
d04f275
Clear hint on EOF (Ctrl+D) too
tailhook May 12, 2020
2b43fef
Detach hint title from completion text
tailhook Jul 9, 2020
a6add02
Handle SIGWINCH while calling move_cursor_at_leftmost
gwenn Jul 26, 2020
4481027
Handle SIGWINCH while calling move_cursor_at_leftmost
gwenn Jul 26, 2020
f537b8f
Merge pull request #420 from gwenn/move_cursor_at_leftmost_interrupt
gwenn Jul 26, 2020
64fff4d
Vi: insert mode escape seq fallback to command mode
Aug 5, 2020
738f2c8
Update nix to 0.18
mexus Aug 8, 2020
698f58f
Merge pull request #428 from mexus/master
gwenn Aug 8, 2020
7ccea3e
Append histo (#419)
gwenn Aug 9, 2020
52f4732
Vi: insert mode escape seq fallback to command mode
gwenn Aug 9, 2020
6e0f34e
Merge pull request #1 from gwenn/poc/vi-insert-seq-fallback-to-comman…
homburg Aug 14, 2020
00e7225
Merge pull request #426 from homburg/poc/vi-insert-seq-fallback-to-co…
gwenn Aug 14, 2020
5668e95
Fix proc_macro
gwenn Aug 23, 2020
5e8191a
Rustfmt
gwenn Aug 23, 2020
32f87be
Merge pull request #431 from gwenn/hint_display
gwenn Aug 23, 2020
e4ec592
Fixed error detection in move_cursor_at_leftmost
Lucretiel Sep 2, 2020
31ce98c
Merge pull request #434 from Lucretiel/windows-errno-fix
gwenn Sep 2, 2020
641c5fb
Support key modifiers
gwenn Sep 6, 2020
b99187e
Support key modifiers
gwenn Sep 6, 2020
af495af
Try to fix Windows build
gwenn Sep 6, 2020
9abc2eb
Refactor code
gwenn Sep 6, 2020
5ccbfe9
Inline variables
gwenn Sep 6, 2020
3ccddad
Fix warning on windows
gwenn Sep 7, 2020
6985c25
Factorize code and trace key on windows
gwenn Sep 7, 2020
c0e9d5e
Remove SHIFT modifier for non control key
gwenn Sep 7, 2020
2c8e664
Rustfmt
gwenn Sep 8, 2020
bf7f187
Normalize key before binding
gwenn Sep 12, 2020
4319dab
Rustfmt
gwenn Sep 12, 2020
1ca2c53
Fix github actions
gwenn Sep 13, 2020
8b7765f
Merge pull request #438 from gwenn/ci
gwenn Sep 13, 2020
ece9877
Replace tuple by tuple struct
gwenn Sep 13, 2020
616936d
Make char_to_key_event function a constructor
gwenn Sep 13, 2020
9b569ac
Normalize Alt-*
gwenn Sep 13, 2020
f1c7ec1
Normalize Alt-*
gwenn Sep 13, 2020
fc5d234
Applied suggested changes
tailhook Sep 30, 2020
0b93b59
Fix clippy warnings
gwenn Oct 4, 2020
a36be1f
Merge pull request #446 from gwenn/clippy
gwenn Oct 4, 2020
27a7c80
Implement Candidate for str
gwenn Oct 4, 2020
928ad1f
Merge pull request #447 from gwenn/candidate_str
gwenn Oct 4, 2020
84e2a88
Disable CPR by default
gwenn Oct 4, 2020
e9408c9
Merge pull request #379 from tailhook/accept_line
gwenn Oct 11, 2020
77b4d00
Rustfmt
gwenn Oct 11, 2020
8f4d899
Merge pull request #449 from gwenn/rustfmt
gwenn Oct 11, 2020
caa710c
Merge pull request #448 from gwenn/check_cursor_position
gwenn Oct 11, 2020
6dcfd61
Merge remote-tracking branch 'upstream/master' into key_mods
gwenn Oct 11, 2020
83999e5
Merge pull request #435 from gwenn/key_mods
gwenn Oct 11, 2020
2d46ea1
Prepare release 6.3.0
gwenn Sep 13, 2020
558bd09
Merge pull request #450 from gwenn/versions
gwenn Oct 11, 2020
95b9006
Ctrl+Left, Ctrl+Right for word skip
gwenn Oct 11, 2020
5596326
Merge pull request #451 from gwenn/ctrl_arrow
gwenn Oct 11, 2020
3116d9d
Implement indentation commands
tailhook Oct 12, 2020
68432a0
Upgrade dependencies and switch back to dirs
gwenn Oct 17, 2020
a0ace4d
Merge pull request #456 from gwenn/deps
gwenn Oct 17, 2020
e9a5ccd
Merge pull request #452 from tailhook/indentation_commands
gwenn Oct 20, 2020
2101528
Ignore EINTR while polling
gwenn Oct 20, 2020
49b83fd
Rustfmt
gwenn Oct 20, 2020
ffd6db9
Use same ordering
gwenn Oct 20, 2020
76e2686
Factored out execute function for the main loop
tailhook Oct 16, 2020
8aa4ed2
Merge pull request #458 from gwenn/poll_eintr
gwenn Nov 9, 2020
90742b3
Merge pull request #455 from tailhook/factor_out_execute
gwenn Nov 11, 2020
1545864
Document Validator::validate_while_typing not being implemented
lberrymage Nov 15, 2020
cbf0f94
Merge pull request #460 from lberrymage/master
gwenn Nov 15, 2020
609d477
Fix input validation
gwenn Nov 15, 2020
517a2e7
Rustfmt + Clippy
gwenn Nov 15, 2020
310f370
Merge pull request #461 from gwenn/invalid_result_msg
gwenn Nov 15, 2020
1f673f8
Prepare release 7.0.0
gwenn Nov 22, 2020
97890b0
Merge pull request #463 from gwenn/release
gwenn Nov 22, 2020
d66f5d9
Fix Ctrl-Right binding
gwenn Nov 25, 2020
36ee2bf
Rustfmt + Clippy
gwenn Nov 25, 2020
755979c
Merge pull request #465 from gwenn/fix_ctrl_right
gwenn Nov 25, 2020
b1f6df5
Migrated to dirs-next due to dirs no longer being maintained
Razican Dec 4, 2020
ddfa159
Merge pull request #468 from Razican/dirs_next
gwenn Dec 4, 2020
b25c2a7
Fix append_history
gwenn Dec 4, 2020
f678a29
Make sure history is always ended by a linefeed
gwenn Dec 4, 2020
61ce4c3
Merge pull request #470 from gwenn/fix_append_history
gwenn Dec 4, 2020
e1d5b4b
Fix clippy warnings
gwenn Dec 6, 2020
5f0b6f0
Shrink dev dependencies
gwenn Dec 6, 2020
e4525c6
Merge pull request #471 from gwenn/clippy
gwenn Dec 6, 2020
232b8d9
Merge pull request #472 from gwenn/dev_deps
gwenn Dec 6, 2020
9c1cf0b
Misc
gwenn Dec 6, 2020
52397a0
Merge pull request #473 from gwenn/misc
gwenn Dec 6, 2020
b755c8a
Mark tty mode as must_use
gwenn Dec 6, 2020
4a87a19
Merge pull request #474 from gwenn/must_use
gwenn Dec 6, 2020
b7d341d
Fix issue: AltGr handled as Ctrl
tofpie Dec 14, 2020
9916697
Merge pull request #476 from tofpie/fix-475
gwenn Dec 15, 2020
e89b5c1
Prepare release 7.1.0
gwenn Dec 15, 2020
62802b6
Merge pull request #477 from gwenn/7.1.0
gwenn Dec 15, 2020
b8fe20b
Fix clippy warning
gwenn Jan 2, 2021
8ec67fe
Rustfmt
gwenn Jan 2, 2021
aa73a05
Merge pull request #478 from gwenn/compare_exchange
gwenn Jan 2, 2021
7ac840b
Add notes on History
gwenn Jan 13, 2021
4c09d52
Add notes on custom bindings
gwenn Jan 13, 2021
8d69ac5
Bracketed paste can be disabled
gwenn Jan 30, 2021
60ae239
Merge pull request #483 from gwenn/disable_bracketed_paste
gwenn Jan 30, 2021
a2bd188
Remove github actions badge
gwenn Feb 5, 2021
716fa5f
Merge pull request #484 from kkawakam/gwenn-patch-1
gwenn Feb 5, 2021
c793588
More bugs
gwenn Feb 16, 2021
7d96d43
dirs versus dirs-next
gwenn Feb 16, 2021
0271090
Merge pull request #481 from gwenn/notes
gwenn Feb 16, 2021
b695a53
[WIP] Conditional binding
gwenn Feb 20, 2021
2c0440e
Add `Any` event and fix `TrieKey` impl
gwenn Feb 21, 2021
b43fc2a
Update deps
kpp Feb 21, 2021
d3ca0fb
Fix clippy warnings on windows
gwenn Feb 22, 2021
2c8ca87
Upgrade nix dependency to version 0.20
gwenn Feb 22, 2021
a5da804
Merge pull request #495 from gwenn/clippy
gwenn Feb 22, 2021
d703f89
Merge pull request #496 from gwenn/nix
gwenn Feb 22, 2021
c1a13a0
bincode is not compatible with subtrie
gwenn Feb 22, 2021
449a38a
Add CI to check features
kpp Feb 23, 2021
7fc64ea
Fix feature with-fuzzy
kpp Feb 23, 2021
afec38b
Use `replxx` encoding
gwenn Feb 23, 2021
dce6d95
Support binding key sequence
gwenn Feb 24, 2021
7a1e05d
Move KeyEvent::encode in binding module
gwenn Feb 27, 2021
97e9625
Fix Clippy warnings
gwenn Feb 27, 2021
24e9389
Merge pull request #497 from gwenn/clippy
gwenn Feb 27, 2021
8e8cf90
Test features
gwenn Feb 27, 2021
5325f38
Merge pull request #498 from gwenn/test_features
gwenn Feb 27, 2021
5fea6b2
Revert changes to github actions file
gwenn Feb 27, 2021
f53c4c1
Merge pull request #499 from gwenn/update_deps
gwenn Feb 27, 2021
b00e10f
Fix warning
gwenn Mar 6, 2021
4eeb2e4
Merge pull request #501 from gwenn/cow
gwenn Mar 6, 2021
15d9f43
Merge remote-tracking branch 'upstream/master' into conditional_binding2
gwenn Mar 6, 2021
bf5bbfd
Add examples for custom key bindings
gwenn Mar 6, 2021
3d692d3
Add example for custom bindings
gwenn Mar 6, 2021
bf55c10
Add example for custom key bindings
gwenn Mar 7, 2021
9c419ba
Merge pull request #492 from gwenn/conditional_binding2
gwenn Mar 7, 2021
c32caac
Prepare release of version 8.0.0
gwenn Mar 7, 2021
b99e014
Merge pull request #502 from gwenn/8.0.0
gwenn Mar 7, 2021
9e96d21
Add minimal example
gwenn Mar 28, 2021
f191537
Merge pull request #506 from gwenn/examples
gwenn Mar 28, 2021
56b925c
Replace fs2 dependency by fd-lock
gwenn Mar 28, 2021
bd73bdd
Merge pull request #507 from gwenn/fd-lock
gwenn Mar 29, 2021
9f1832b
Fix KeyEvent::encode
gwenn Apr 4, 2021
b6f4803
Implement Candidate for &'static str
gwenn Apr 7, 2021
e33e26c
Use &'_ str instead of &'static str
gwenn Apr 7, 2021
24a9586
Merge pull request #511 from gwenn/collision
gwenn Apr 8, 2021
348361b
Merge pull request #512 from gwenn/static_candidate
gwenn Apr 8, 2021
a3f20c0
Support Partial Completion
schrieveslaach Apr 14, 2021
8f4d253
Add clippy and format checks
gwenn Apr 17, 2021
bc78737
Merge pull request #514 from gwenn/ci
gwenn Apr 17, 2021
2f47843
Merge pull request #513 from schrieveslaach/complete-hint-with-next-word
gwenn May 2, 2021
d3c5554
Fix clippy warnings
gwenn May 2, 2021
36752fe
Merge pull request #516 from gwenn/clippy
gwenn May 2, 2021
c1416d6
Support ESC ESC, fix alt+arrow movement
thomcc May 2, 2021
c1dd18f
Add input_multiline example
basile-henry May 5, 2021
d3e789c
Handle multiline inputs in non TTY readline
basile-henry May 5, 2021
7006f3b
Better handling of newline \r\n vs \n
basile-henry May 6, 2021
2a2b2f6
Handle backspace character in non TTY mode
basile-henry May 6, 2021
125729d
Don't complete input on Invalid
basile-henry May 6, 2021
2de69cf
Write validator messages in non TTY mode
basile-henry May 6, 2021
e1c1d0e
C-v on Windows will now paste from the clipboard
marcbowes May 7, 2021
a260289
Run cargo fmt
marcbowes May 8, 2021
307bd32
Enable 'std' for winapi, fixes #520
marcbowes May 8, 2021
7081b23
Merge pull request #522 from marcbowes/winapi-std
gwenn May 9, 2021
d48d012
Merge pull request #521 from marcbowes/winclip
gwenn May 9, 2021
7958675
Merge pull request #517 from thomcc/escesc
gwenn May 9, 2021
6943840
More consistent newline stripping in readline_direct buffer
basile-henry May 9, 2021
30b8972
Test Incomplete case with different line endings in readline_direct
basile-henry May 9, 2021
12738f1
Prepare release of version 8.1.0
gwenn May 16, 2021
957a677
Merge pull request #524 from gwenn/8.1.0
gwenn May 17, 2021
370fc5b
Fix clippy warnings (#525)
gwenn May 17, 2021
35d84a4
Fix line wrap predicate (#523)
flappyBug May 18, 2021
3ae62ec
Remove need for error-code direct usage (#526)
DoumanAsh May 20, 2021
dd0928e
Prepare release 8.2.0 (#527)
gwenn May 20, 2021
ee0529a
Upgrade to nix 0.21
gwenn Jun 4, 2021
a3ee2e6
Merge pull request #531 from gwenn/nix
gwenn Jun 6, 2021
e8f9a3c
Implement Invoke for str
gwenn Jun 13, 2021
5547271
Merge pull request #534 from gwenn/invoke_str
gwenn Jun 13, 2021
e46fdd7
Merge remote-tracking branch 'origin/master' into multiline-non-tty
basile-henry Jun 13, 2021
63db9b1
Use Invoke impl for &str
basile-henry Jun 13, 2021
9608501
Use stderr for validator messages in non-TTY contexts
basile-henry Jun 13, 2021
13a0b71
Merge pull request #518 from basile-henry/multiline-non-tty
gwenn Jun 13, 2021
037d1c3
Load terminal settings for VINTR, VQUIT, VSUSP on Unix
gwenn Jun 13, 2021
80e5e85
Fix windows impl
gwenn Jun 13, 2021
8f478bd
Clippy
gwenn Jun 16, 2021
059ce10
Merge pull request #537 from gwenn/clippy
gwenn Jun 16, 2021
8725a40
Misc (#538)
gwenn Jun 20, 2021
20058ae
Merge remote-tracking branch 'upstream/master' into term_key_map
gwenn Jul 3, 2021
74c454c
Bind Ctrl-C to Interrupt only on Windows by default
gwenn Jul 3, 2021
ccf2235
Refactor History search
gwenn Jul 11, 2021
f4c0508
Upgrade to nix 0.22
gwenn Jul 13, 2021
4bda11d
Merge pull request #544 from gwenn/nix
gwenn Jul 13, 2021
3dccc18
Try to keep the distinction between backspace and ctrl-h on windows
gwenn Jul 14, 2021
5acfbd3
Check wVirtualKeyCode even if uChar is not zero
gwenn Jul 14, 2021
eb68960
Fix prefix-based search
gwenn Jul 14, 2021
ed409d7
Merge pull request #545 from gwenn/history_search
gwenn Jul 14, 2021
f6b85b9
Case-insensitive history search
gwenn Jul 14, 2021
c19c998
Fix compilation error on windows
gwenn Jul 15, 2021
9767521
Fix test on windows
gwenn Jul 15, 2021
3d24f0c
Use automatically_derived attribute on impl blocks
gwenn Jul 18, 2021
df4a852
Upgrade env_logger to 0.9
gwenn Jul 18, 2021
837f849
Merge pull request #547 from gwenn/windows_keys
gwenn Jul 18, 2021
08f3cba
Merge pull request #548 from gwenn/automatically_derived
gwenn Jul 18, 2021
384f2dd
Merge pull request #549 from gwenn/env_logger
gwenn Jul 18, 2021
2d2af8b
Fix cargo miri test --lib
gwenn Jul 18, 2021
bb6534e
Merge pull request #550 from gwenn/miri
gwenn Jul 18, 2021
be32b59
Clean github actions file
gwenn Jul 18, 2021
250c9e6
Merge pull request #551 from gwenn/actions
gwenn Jul 18, 2021
9aa3d25
Upgrade fd-lock to version 3.0.0
gwenn Jul 21, 2021
ef7c0dc
Merge pull request #553 from gwenn/fd-lock
gwenn Jul 21, 2021
2da002d
Merge pull request #546 from gwenn/case_insensitive_history_search
gwenn Jul 26, 2021
b46975e
Fix complete hint
gwenn Aug 3, 2021
6e5a7c6
Ignore empty hint
gwenn Aug 3, 2021
dbf7fd0
Fix Hinter implementations
gwenn Aug 3, 2021
2626e72
Merge pull request #556 from gwenn/complete_hint
gwenn Aug 4, 2021
eb9872d
Try to handle VEOF binding
gwenn Aug 5, 2021
92b4187
Handle VEOF like editline
gwenn Aug 5, 2021
2e718e8
Fix some typos
gwenn Aug 8, 2021
6826b02
Merge pull request #557 from gwenn/typos
gwenn Aug 8, 2021
7c162cb
Misc
gwenn Aug 8, 2021
eab5d18
Merge pull request #558 from gwenn/misc
gwenn Aug 8, 2021
6e29ae5
Fix history persistence bugs
gwenn Aug 13, 2021
bcd5d10
Fix history persistence bugs
gwenn Aug 13, 2021
26274da
Fix history persistence bugs
gwenn Aug 13, 2021
48bc294
Fix history persistence bugs
gwenn Aug 14, 2021
9f5a9e9
Merge pull request #560 from gwenn/history_bugs
gwenn Aug 14, 2021
ad1a16d
Prepare release 9.0.0
gwenn Aug 17, 2021
6b46b57
Merge pull request #561 from gwenn/9.0.0
gwenn Aug 17, 2021
3bb15c4
Fix crates.io badge
atouchet Sep 1, 2021
4fe21c8
Perform github actions even if only markdown files are touched
gwenn Sep 4, 2021
38e07b3
Merge pull request #565 from gwenn/badge
gwenn Sep 4, 2021
c2e02ed
Disable default-features for both syn and quote
gwenn Sep 4, 2021
6c95909
Fix clippy warning
gwenn Sep 4, 2021
a1b255c
Merge pull request #566 from gwenn/syn_features
gwenn Sep 4, 2021
1b6f20d
Merge pull request #567 from gwenn/clippy
gwenn Sep 4, 2021
16ddeb5
Upgrade dependencies
gwenn Oct 1, 2021
5355a3f
Merge pull request #568 from gwenn/deps
gwenn Oct 1, 2021
eac4a24
Migrate to 2021 edition
gwenn Oct 21, 2021
2dc2422
Merge pull request #570 from gwenn/2021_edition
gwenn Oct 21, 2021
de33138
Merge pull request #535 from gwenn/term_key_map
gwenn Oct 23, 2021
f023b1d
Remove redundant is_some() check
gwenn Nov 1, 2021
c648126
Misc
gwenn Nov 1, 2021
f2cf638
Fix interrupted interactive search
gwenn Dec 4, 2021
cbac6bd
Rename edit_move_to_end to move_cursor_to_end
gwenn Dec 4, 2021
ff5e526
Fix key_map initial capacity
gwenn Dec 4, 2021
ecf039c
Merge pull request #576 from gwenn/edit_move_to_end
gwenn Dec 4, 2021
96a5c1c
Merge pull request #577 from gwenn/var
gwenn Dec 4, 2021
957aea5
Merge pull request #571 from gwenn/misc
gwenn Dec 4, 2021
4833aa5
Prepare release 9.1.0
gwenn Dec 4, 2021
1a4188b
Merge pull request #578 from gwenn/9.1.0
gwenn Dec 4, 2021
698509e
Add reedline to similar projects
gwenn Dec 5, 2021
71cba36
Merge pull request #579 from gwenn/reedline
gwenn Dec 5, 2021
a951dd2
Fix clippy warnings
gwenn Dec 11, 2021
4ff19c0
Merge pull request #580 from gwenn/clippy
gwenn Dec 11, 2021
7a13e8c
Revert to edition 2018
gwenn Dec 11, 2021
2dd95df
Prepare release of version 9.1.1
gwenn Dec 11, 2021
4761f12
Merge pull request #582 from gwenn/edition
gwenn Dec 11, 2021
c54d9d8
Implement optional rectangular prompt support
tailhook Apr 22, 2020
7be054a
Fix bug of `has_continuation` applied to non-default prompt
tailhook Oct 1, 2020
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
44 changes: 44 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Rust

on:
push:
branches: [master]
paths:
- '**.rs'
- '**.toml'
- '.github/workflows/rust.yml'
pull_request:
paths:
- '**.rs'
- '**.toml'
- '.github/workflows/rust.yml'
- '*.md'
env:
RUST_BACKTRACE: 1
jobs:
build:

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt, clippy
- name: Build
run: cargo build --workspace --all-targets
- name: Run tests
run: cargo test --workspace --all-targets
- name: Run doctests
run: cargo test --workspace --doc
- name: Test features
if: matrix.os != 'windows-latest'
run: cargo test --workspace --all-targets --all-features
- name: Clippy
run: cargo clippy --workspace -- -D warnings
- name: Format
run: cargo fmt --all -- --check
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# Compiled files
*.o
*.so
*.rlib
*.dll

# Executables
*.exe

# Generated by Cargo
/target/
Cargo.lock
Expand Down
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

22 changes: 21 additions & 1 deletion BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Know issues

We would like to introduce an incremental parsing phase (see `tree-sitter`).
Because, when you have tokens (which may be as simple as words) or an AST,
completion / suggestion / highlting / validation become easy.
completion / suggestion / highlighting / validation become easy.
So we need to send events to a lexer/parser, update `Document` accordingly.
And fix `Completer` / `Hinter` / `Highlighter` API such as they have access to `Document`.

Expand All @@ -16,6 +16,10 @@ Currently, performance is poor because, most of the time, we refresh the whole l
We would like to transform events on prompt/line/hint into partial repaint.

See `termwiz` design (`Surface`).
See `replxx` refresh delay (`_lastRefreshTime`) or `python-prompt-toolkit` max_render_postpone_time.
https://docs.rs/xi-unicode/0.3.0/xi_unicode/struct.LineBreakIterator.html
https://github.com/xi-editor/xi-editor/blob/master/rust/core-lib/src/linewrap.rs
[vt100](https://docs.rs/vt100/0.12.0/vt100/struct.Screen.html#method.contents_diff)

## Action / Command

Expand All @@ -24,3 +28,19 @@ To do so, we need to refactor current key event dispatch.

See `replxx` design (`ACTION_RESULT`, `action_trait_t`).

## Line wrapping (should be fixed with versions >= 6.1.2)

On Unix platform, we assume that `auto_right_margin` (`am`) is enabled.
And on Windows, we activate `ENABLE_WRAP_AT_EOL_OUTPUT`.
But on Windows 10, `ENABLE_WRAP_AT_EOL_OUTPUT` and `ENABLE_VIRTUAL_TERMINAL_PROCESSING` seems to be incompatible.

## Colors

We assume that ANSI colors are supported.
Which is not the case on Windows (except on Windows 10)!

## Emoji

https://github.com/kkawakam/rustyline/issues/184
https://docs.rs/xi-unicode/0.3.0/xi_unicode/trait.EmojiExt.html
https://docs.rs/termwiz/0.11.0/termwiz/cell/fn.grapheme_column_width.html
40 changes: 27 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustyline"
version = "5.0.5"
version = "9.1.1"
authors = ["Katsu Kawakami <kkawa1570@gmail.com>"]
edition = "2018"
description = "Rustyline, a readline implementation based on Antirez's Linenoise"
Expand All @@ -12,41 +12,55 @@ license = "MIT"
categories = ["command-line-interface"]

[badges]
travis-ci = { repository = "kkawakam/rustyline" }
appveyor = { repository = "kkawakam/rustyline" }
maintenance = { status = "actively-developed" }

[workspace]
members = ["rustyline-derive"]

[dependencies]
cfg-if = "0.1"
dirs = { version = "2.0", optional = true }
bitflags = "1.3"
cfg-if = "1.0"
# For file completion
# https://rustsec.org/advisories/RUSTSEC-2020-0053.html
dirs-next = { version = "2.0", optional = true }
# For History
fd-lock = "3.0.0"
libc = "0.2"
log = "0.4"
unicode-width = "0.1"
unicode-segmentation = "1.0"
memchr = "2.0"
# For custom bindings
# https://rustsec.org/advisories/RUSTSEC-2021-0003.html
smallvec = "1.6.1"
radix_trie = "0.2"
regex = { version = "1.5.4", optional = true }

[target.'cfg(unix)'.dependencies]
nix = "0.14"
utf8parse = "0.1"
nix = "0.23"
utf8parse = "0.2"
skim = { version = "0.9", optional = true }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["consoleapi", "handleapi", "minwindef", "processenv", "winbase", "wincon", "winuser"] }
winapi = { version = "0.3", features = ["consoleapi", "handleapi", "minwindef", "processenv", "std", "winbase", "wincon", "winuser"] }
scopeguard = "1.1"
clipboard-win = "4.2.1"

[dev-dependencies]
env_logger = "0.7"
tempdir = "0.3"
doc-comment = "0.3"
env_logger = { version = "0.9", default-features = false }
tempfile = "3.1.0"
assert_matches = "1.2"
rustyline-derive = { version = "0.2.0", path = "rustyline-derive" }
rustyline-derive = { version = "0.6.0", path = "rustyline-derive" }

[features]
default = ["with-dirs"]
with-dirs = ["dirs"]
with-dirs = ["dirs-next"]
with-fuzzy = ["skim"]
case_insensitive_history_search = ["regex"]

[package.metadata.docs.rs]
features = ["with-dirs"]
features = ["with-dirs", "with-fuzzy"]
all-features = false
no-default-features = true
default-target = "x86_64-unknown-linux-gnu"
68 changes: 68 additions & 0 deletions CustomBinding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## Related topics

* [Multiple commands for a keybinding](https://github.com/kkawakam/rustyline/issues/306) and
[Conditional Bind Sequences](https://github.com/kkawakam/rustyline/issues/269) : original issues
* [Conditional Bind Sequences](https://github.com/kkawakam/rustyline/pull/293) : incomplete proposal
* [Add `Cmd::Yield` for complex custom bindings](https://github.com/kkawakam/rustyline/pull/342) : another proposal
* [Initial invoke trait and auto-indent example](https://github.com/kkawakam/rustyline/pull/466) : a validator is like a custom action triggered indirectly.

And other issues that should be solved if our design is good:
* [Extend Meta-F,Alt+Right feature for hint partial completion](https://github.com/kkawakam/rustyline/pull/430)
* [Use Arrow-Up to search history with prefix](https://github.com/kkawakam/rustyline/issues/423)
* [Execute Arbitrary Command Via Keybinding](https://github.com/kkawakam/rustyline/issues/418)
* [Use Ctrl-E for hint completion](https://github.com/kkawakam/rustyline/pull/407)
* [Add History Search Behaviour](https://github.com/kkawakam/rustyline/pull/424)
* ...

## Conditions / Filters
See https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/key_bindings.html?highlight=filter#attaching-a-filter-condition

Some keys/commands may behave differently depending on:
* edit mode (emacs vs vi)
* vi input mode (insert vs replace vs command modes)
* empty line
* cursor position
* repeat count
* original key pressed (when same command is bound to different key)
* hint
* ...

## More input
Some keys/commands may ask for more input.
I am not sure this point should be tackle here.

## Multiple / complex actions
For one key/command, we may want to perform multiple actions.
We should ask the undo manager to start a "transaction" before first action and commit it after the last action.
Should we do something specific with the kill ring ?
We should refresh / repaint only when all actions are performed (or if ask explicitly?) depending on cumulated action impacts.
...

## Misc

```rust
/// Command / action result
#[derive(Debug, Clone, PartialEq, Copy)]
#[non_exhaustive]
pub enum ActionResult {
// Interrupt / reject user input
// => Err should be fine
//Bail,
///
Continue,
/// Accept user input (except if `Validator` disagrees)
Return,
}
```
```rust
bitflags::bitflags! {
#[doc = "Action invocation impacts"]
pub struct Impacts: u8 {
const PUSH_CHAR = 0b0000_0001;
const BEEP = 0b0000_0010;
const MOVE_CURSOR = 0b0000_0100; // State::move_cursor
const REFRESH = 0b0000_1000; // State::refresh_line
const CLEAR_SREEN = 0b0001_0000; // State::clear_screen
}
}
```
35 changes: 35 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Config
max_history_size

# Current session

* we should remember (index) of the first line inserted by this session.
- if no line has been inserted => do nothing on save
- reset this index after saving successfully.
* we should remember (path and timestamp) of the file used to initialize/`load` history.
- if path used to save history is the same:
+ if timestamp is still the same => we can append only new lines if history has not been truncated.
+ update timestamp after saving successfully.
* we should remember (path and timestamp) of the file used to persist/`save` history.
- reset them if `load` is then called with a different path
- update them if `load` is then called with same path.
- update them after saving successfully
- if path used to save history is the same:
+ if timestamp is still the same => we can append only new lines if history has not been truncated.

```
HistoryInfo
first_add_index: Option<usize>, // first line inserted by this session
truncated: bool //
path_info: Option<PathInfo>,
```
```
PathInfo
path: Path,
modified: SystemTime,
```

---
With `termwiz`, you can define your own `History` backend.
`termwiz` does not specify anything how the history is persisted.
Only how to access / search history entry.
52 changes: 52 additions & 0 deletions Incremental.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Incremental computation

We would like to avoid redrawing all row(s) when an event occurs.
Currently, we redraw all row(s) except when:
* a character is inserted at the end of input (and there is no hint and no `highlight_char`),
* only the cursor is moved (input is not touched and no `highlight_char`).

Ideally, we would like to redraw only impacted row(s) / cell(s).

### Observable values

Currently, we assume that highlighting does not impact layout / rendered text size.
So only the following observables impact layout:
* prompt (interactive search, [input mode indicator](https://github.com/kkawakam/rustyline/pull/369)),
* [input mode](https://github.com/kkawakam/rustyline/pull/369),
* line(s) buffer,
* cursor position,
* hint / input validation message,
* screen size (line wrapping),
* [prompt continuation](https://github.com/kkawakam/rustyline/pull/372)s,
* row/wrap count.

Some other values may impact layout but they are/should be constant:
* tab stop,

### Line wrapping and highlighting

Currently, there is no word wrapping (only grapheme wrapping).
But we highlight the whole input at once.
So there is no issue: for example, even if a keyword is wrapped, style is preserved.

With [prompt continuation](https://github.com/kkawakam/rustyline/pull/372)s,
we (will) interleave user input with continuations.
So we need to preserve style.

TODO How prompt_toolkit handle this problem ?
Maybe using ANSI sequence directly was a bad idea. If `Highlighter` returns style ranges,
applying style on input slice is easy (and also supporting styles on Windows < 10).

### Impacts

Current granularity:
* PUSH_CHAR at end of input
* BEEP
* MOVE_CURSOR
* REFRESH whole input / rows
* CLEAR_SCREEN (+REFRESH)

Wanted additional granurality:
* PUSH_STRING at end of input
* REFRESH_DIRTY only rows / cells

Loading