Commit Graph

83 Commits

Author SHA1 Message Date
Darren Schroeder
2e7483fe4d
update some deps (#453) 2022-07-25 20:32:57 -05:00
Stefan Holderbach
117f13b005
Prepare the 0.8.0 release (#448) 2022-07-05 10:38:36 +02:00
Eric Hodel
0680bb584a
Add vi WORD motions B, E, W (#441)
* 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
2022-06-16 11:58:19 +02:00
Stefan Holderbach
f14583526a
Prepare 0.7.0 release (#440)
Includes the new History API and their backends
2022-06-14 22:46:04 +02:00
phiresky
4f25ce5633
SQLite History and replaceable History backends (#401)
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>
2022-06-06 18:11:02 +02:00
Stefan Holderbach
09bbb24bfd
Update nu-ansi-term and crate patches (#437)
- Update `nu-ansi-term` to remove `Deref` impl
- General `cargo update`
2022-06-03 21:11:59 +02:00
Stefan Holderbach
d8ff270f94
Prepare the v0.6.0 release (#430) 2022-05-23 23:59:07 +02:00
Stefan Holderbach
ef6499202a
Prepare the 0.5.0 release (#421)
`Cargo.toml` version bump
2022-05-03 21:16:00 +02:00
sholderbach
2176424cec
Finalize v0.4.0 2022-04-12 11:39:54 +02:00
Darren Schroeder
bc528de132
bump to 0.3.1 and nu-ansi-term to 0.45.1 (#361) 2022-03-27 15:42:39 +13:00
Stefan Holderbach
c0543b875c
Prepare for new release (#352)
- Update dependencies
- Increase version number to 0.3.0
2022-03-16 23:58:25 +01:00
JT
3d933d52ce
Better crossterm fix (#329)
* Move to crossterm on git

* Better fix for crossterm
2022-03-01 06:32:14 -05:00
JT
470b20129d
Move to crossterm on git (#328) 2022-03-01 05:41:23 -05:00
Stefan Holderbach
e314e8491e
Revert crossterm: key modifier issue on win (#326)
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
2022-02-26 14:51:38 +01:00
Stefan Holderbach
65cfd6bcbd
Bump dependencies and edition to 2021 (#310) 2022-02-24 00:09:58 +01:00
Stefan Holderbach
92b299916e
Make appending and truncating history file thread safe (#299)
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
2022-02-06 00:20:44 +01:00
Darren Schroeder
a55884390e list things 2022-01-29 15:50:05 -06:00
Stefan Holderbach
2c24ff6140
Bump dependency versions (#232)
Make sure we are up to date on unicode crates et al.
2022-01-02 20:19:11 +01:00
Darren Schroeder
6884ec4062
add the ability to optionally turn off ansi coloring (#197)
* add the ability to optionally turn off ansi coloring

* also strip from the hinter
2021-12-09 21:48:08 +01:00
Stefan Holderbach
550ce9b486
Bump dependency versions (#177) 2021-11-08 10:49:30 +13:00
JT
93c2146fcf
Bump version (#152)
* Bump to 0.2

* Add to README

* Improve top docs

* Clear to the end of each newline to remove any leftovers
2021-09-24 07:40:32 +12:00
Sherub Thakur
30f9d419f3
Add tests to emacs and vi edit mode (#146)
* 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
2021-09-22 16:37:19 +12:00
JT
cd87851ad9
Cleanup some deps and improve build times (#144) 2021-09-06 05:39:19 +12:00
JT
ccce8d5fa1
Fix double chars (#140)
* Fix double chars

* Fix double chars

* Updates

* doctest fixes

* see if it's paying attention

* see if it's paying attention
2021-09-05 07:32:02 +12:00
Sherub Thakur
83ab5ddd6a
Add pretty_assertions lib (#73) 2021-06-24 06:07:58 +12:00
Darren Schroeder
0a224bef05
syntax highlighting fileio (#56)
* syntax highlighting fileio

* add an example syntax json file

* complied with jt's wishes because reasons :)
2021-06-16 08:02:29 +12:00
JT
e0714819e4
Add configurable keybindings (#51) 2021-06-11 12:08:09 +12:00
Stefan Holderbach
afd2c9526e
Basic API docs to give an overview of the current state (#47)
* 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
2021-05-04 12:12:08 +02:00
Guillermo Lella
6c8ca05b4c
added OS's clipboard (#43)
Should work in Linux, macOS and Windows
2021-04-26 18:55:49 +12:00
Jonathan Turner
c376cefd3e
Begin multiline editing (#35) 2021-03-21 11:01:28 +13:00
Darren Schroeder
6ec4f86068
added a slightly-fancy prompt (#29) 2021-03-19 06:39:23 +13:00
Jonathan Turner
1473098ff2
Merge in refactor and unicode work (#3)
* First stage of refactor

* Finish moving to insertion point

* refactor to move word

* WIP

* Working a bit better
2021-03-06 11:30:44 +13:00
Niklas Schoellhorn
21180f15b5 Implement primitive word-jumping
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.
2021-03-01 08:36:19 +01:00