Addresses #320, #236
* Adding External printer
* Made ExternalPrinter as an optional feature. Clippy is happy, test pass, docs added.
* ExternalPrinter: prints multiple messages if available, more on error-handling.
* Bug(s) fixed. Prints messages. Working example in examples folder. Code formatted, clippyed, tests pass.
* Generic ExternalPrinter<T> where T: Display.
* Fixed: Works with buffers larger than a line.
* Fixed: Works with buffers larger than a line, refactored.
* Different approach, seems to look like what is expected. Gives the "illusion" of one line being entered. Needs more testing, could have some off by one errors ;)
Co-authored-by: Gregor Engberding <gregor@meinkopter.de>
`rstest = 0.12` added support for asynchronous timeouts during testing
thus requiring a larger set of dependencies. Since `rstest = 0.14` this
can be disabled if not used.
Should keep build times for local or CI tests in check.
This new crossterm version includes a breaking change to the indexing of
certain cursor move operations:
https://github.com/crossterm-rs/crossterm/releases/tag/0.24
While reedline itself might not be affected, check the code of the
consuming application that needs to match the crossterm version!
* Add vi W motion
This moves forward by WORD which is a sequence of non-blank characters
separated by whitespace.
* Add vi B motion
Support deleting backward for word (db) and WORD (dB)
* Add vi E motion
Changes the history API to support different storage backends and more rich information to be used as metadata/filtering criterions.
Includes a SQLite backed history with additional fields and ports the simple `FileBackedHistory` format consistent.
Includes a `HistoryCursor` to abstract the internal interactive browsing.
Updates `History` trait to cover the API to load and store to the storage backend.
Commits
* basic sqlite history
* fix test compilation
* final touches for MVP
* better documentation
* fix for empty history
* partial change to non-generic history
* mostly working
* fix tests and ci
* fixes, format
* move history item to new file
* fix some comments, fix test compile errors
todo: fix tests
* ci features matrix
* fix index creation
* fix file-based tests
* move logic for not saving empty entries to engine
* fix update last command on empty, set up application_id and check version
* add specific error variants
* format
* fix compile errors
* fix fmt
* sqlite with bashisms
* hide with features
* cargo fmt
* improve performance of bashisms selectors
* Style: Remove commented out code
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: Fernando Herrera <fernando.j.herrera@gmail.com>
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
crossterm 0.23 seems to have introduce a regression on windows for
decoding keybindings with `ctrl` that uppercases the char.
Tracking issue crossterm-rs/crossterm#636
Might be fixed by crossterm-rs/crossterm#629
Add safe `sync` method to `History`
This method both reads from the file and writes local additions. Is safe
when multiple `History` instances try to truncate the history file on
disk.
To avoid race conditions on the file uses the `fd_lock` crate for file
advisory locks. (Inspiration for that thanks to rustyline: https://github.com/kkawakam/rustyline/blob/master/src/history.rs)
Fixes#221
- Cover history file ops with tests
- Add test for conflicting writes that should truncate
- Add safe `sync` method to `History`
- Test `FileBackedHistory` for threadsafety
* Add equality derive for EditCommand and ReedlineEvent
* Move matches to keybinds for emacs edit mode
* Simplify event matching in emacs edit mode
* Bugfix: All matches happening at same point
* Add failing test to check keybinding override
* Bugfix: Inserting capital character works
* Unknown requirement: test to be to capture currently unknown requirement
* Add rstest
The reason is to easily write parameterized tests
* Add test: for emoji input to emacs
* Add tests and fixes for vi edit mode
* Reedline None event and vi keybinds
* Keybindings are overridable
* Vi Reedline::None
* Doctests for History
* Improve the general documentation of History.
* Doc tests to understand the API.
* Includes regression test to read back correctly from file.
* Run doctests in CI
* Minimal doc comments for Clipboard
* Basic API docs for the most important components
Still work in progress
* Add README and lib.rs docs
* Document more internals to help new contributors
* Doctest linebuffer
* Revert "Doctest linebuffer" for now
This reverts commit 08ff9c152c.
* Format run