* 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
With this patch, if you hold ALT (or Option on Mac) and then
press Arrow Left or Arrow Right, the cursor will jump over the
whole word instead of just one character to allow for more
natural text editing.