Commit Graph

446 Commits

Author SHA1 Message Date
Stefan Holderbach
78a81adf87
Revert removal of patch versions (#590)
Reincludes the patch versions that were removed in #586 to ensure
reedline gets built with a version with which we tested reedline at some
point.
2023-06-06 11:26:53 +02:00
WMR
79778f7b85
Update to make work with new lines embedded in sent string. (#588)
* Update to make work with new lines embedded in sent string.

* Appease fmt
2023-05-30 17:20:20 -05:00
Darren Schroeder
f7515b40e5
update cargo.lock (#587)
* update cargo.lock

* update timestamp_millis_opt
2023-05-26 08:58:50 -05:00
Darren Schroeder
8c4001b845
update dependencies (#586) 2023-05-26 08:26:42 -05:00
JT
e0e5957a5d
bump reedline version (#585) 2023-05-25 11:12:48 +12:00
IchHabeKeineNamen
bd306945b6
fix: prompt position on resize (#578)
* fix: prompt position on resize

* fix: u16 overflow

* fix: prompt position when terminal grows in height

* fix: exclude blank area from prompt height

fix: resume the early return to exclude a case where the terminal got smaller but the prompt is still visible

* fix: prevent any line overwriting at the cost of duplicate prompts

* fix: prevent width change from eating previous output
2023-05-25 11:07:44 +12:00
TrMen
7f54706cab
Allow binding of CTRL+ALT+<c>, CTRL+ALT+SHIFT+<c>, and <c> (#580)
Combinations like `Ctrl+Alt+a` could not be mapped previously, since
some non-us keyboard layouts use those combinations for sending
characters like `@`.

Now, first check if there a binding was defined using that combination,
else interpret as raw characters. This should not affect those special
keyboard layouts, since they would be sending `Ctrl+Alt+<special char>`,
rather than what would be on the US layout.

E.g.
- Map `Ctrl+Alt+a` to an action
- `Ctrl+Alt+a` on (some) german keyboards would send `@`
- A german layout pressing those keys would send a key combination of `Ctrl+Alt+@`,
  so they are unaffected by this change (they would have to specifically
  map `Ctrl+Alt+@`)
- For any layout actually sending `Ctrl+Alt+a`, they get the mapped action

This also allows the user to bind a keybinding without modifiers.

This affects emacs mode and vi insert mode (vi normal mode
already allows such keybindings).
2023-05-05 12:38:28 +02:00
samlich
97f754425a
History filter (#566)
* add `HistoryFilter` and use it in engine, to allow not storing items with a given prefix

* use `with_history_exclusion_prefix` in demo

* review

* impl history filter on engine

* keep 1 filterered history item

* don't impl History on Box<T: History>
2023-05-03 23:25:42 +02:00
WindSoilder
65c4e7a419
fix bracketed paste (#577) 2023-05-02 21:54:09 +02:00
Stefan Holderbach
ec002a7ce8
Bump version for 0.19 release (#575) 2023-04-25 18:57:01 +02:00
nibon7
86beb8793e
Restore the cursor shape when reedline exits (#574) 2023-04-24 20:08:24 +02:00
WindSoilder
3b60811f57
support bracketed paste (#571)
* support bracketed paste

* update demo

* fix clippy

* no need to enable bracketed paste, leave the behavior to user
2023-04-24 20:07:56 +02:00
Steven Xu
a366cf2926
feat: add current_insertion_point() to return the current insertion point of the input buffer (#573) 2023-04-23 06:30:28 -05:00
Justin
f6b23420e2
re-export crossterm::style::Color for custom prompt implementations (#569) 2023-04-18 07:14:16 -05:00
Darren Schroeder
61c6409fb7
Allow history searching via session id (#562)
* add the ability to search history with session id

* clippy
2023-04-18 07:13:49 -05:00
WindSoilder
27f4417191
Update crossterm to version 0.26.1 (#560)
* update crossterm to 0.26.1

* add event_listener_kitty_proto example

* add comment

* remove trait
2023-04-13 19:24:17 +02:00
Stefan Holderbach
89cb811838
Bump version for 0.18.0 release (#564)
for `nushell 0.78.0`
2023-04-03 23:32:06 +02:00
Darren Schroeder
9d6e22dd06
show the ability to have multiple modifiers (#559) 2023-03-23 07:07:27 -05:00
Jérémy Audiger
31743c8488
Add const to some new functions. (#555)
* Add const to some new functions.

* Add const to SearchFilter builders.

* Add const to SearchQuery builders.
2023-03-22 19:23:44 +01:00
Ryan Whitehouse
781e73a2be
Allow multi byte characters as the marker without panicking (#553)
* Allow multi byte characters as the marker without panicking

* Clean up tests and add one for the remainder

* Remove extra whitespace

* Add missing feature toggle

* Clean up tests
2023-03-21 12:43:17 +01:00
Hofer-Julian
f75afbdeba
Check typos in CI (#557) 2023-03-19 20:07:29 +01:00
Jérémy Audiger
af7b447a06
Set MSRV to 1.62.1 (#554)
* Set MSRV to 1.62.1

* Update gitignore file to harmonize it.
2023-03-17 18:46:43 +01:00
micron-mushroom
5ba547cf51
fix: singlebyte char assumption in parse_selection_char (#548)
Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2023-03-15 18:30:40 +01:00
Clément Nerma
3c010ccd34
Make Event public to allow implements custom EditMode (#552) 2023-03-15 18:28:00 +01:00
Stefan Holderbach
35579194f7
Bump version for 0.17.0 release (#550)
Intended for nu 0.77
2023-03-13 23:29:33 +01:00
Stefan Holderbach
6a67d27e70
Update nu-ansi-term to 0.47.0 (#549)
See release notes:

https://github.com/nushell/nu-ansi-term/releases/tag/v0.47.0
2023-03-13 23:01:39 +01:00
Stefan Holderbach
92cb330925
Apply clippy lints (#551)
MSRV >= 1.62
2023-03-13 22:52:36 +01:00
pwygab
ac1d9549a3
allow reedline ctrl+o to take editor arguments (#544)
* allow reedline ctrl+o to take editor arguments

* clippy
2023-02-26 20:05:05 +01:00
Stefan Holderbach
0082cc39ae
Bump version for 0.16.0 release. (#542)
Expected to contain minor bugfix and work on `History::clear` API (work
to improve history metadata handling still in progress)
2023-02-20 22:22:06 +01:00
Stefan Holderbach
1801496be2
Bump rstest to 0.16 (#541)
https://github.com/la10736/rstest/blob/master/CHANGELOG.md
2023-02-19 19:24:09 +01:00
Reilly Wood
03fdb00d3e
VACUUM after deleting SQLite data (#538) 2023-02-14 20:12:00 +01:00
Darren Schroeder
572a391211
add history-clear to demo (#537) 2023-02-10 18:34:30 +01:00
Reilly Wood
d83cc56cb5
Add History::clear() function (#536)
* Add History::clear() function

* Add file-backed history test
2023-02-09 13:33:12 +01:00
Kornél Csernai
829a1a9f49
Fix columnar menu completion corrupting the editor insertion point (#534)
* fix columnar menu issue and add test

* use saturating_add/sub
2023-02-01 16:46:18 +01:00
Stefan Holderbach
c658bea04f
Bump version for 0.15 release (#532)
Necessary for the `0.75` nushell release
2023-01-30 22:19:05 +01:00
Stefan Holderbach
0ba5ad07d8
Remove unstable rustdoc lint (#533)
`rustdoc::missing_doc_code_examples` apparently only works on nightly and causes unnecessary warnings appearing in the CI output.
2023-01-30 22:18:09 +01:00
Doug Kelkhoff
e1366260c1
Allow configuration of multiline prompt color (#531)
* make multiline prompt color configurable

* remove unnused use statements

* minor comment update

* Clippy fix

new lints from rust 1.67

* Cargo fmt

---------

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2023-01-27 15:58:25 +01:00
Stefan Holderbach
3d83306b2d
Fix the Github actions badge (#523) 2022-12-21 13:00:50 +01:00
Carl Schierig
475495d785
Make reedline handling cursor shapes more configurable (#515)
Adds a struct to configure the cursor shape

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
resolve https://github.com/nushell/reedline/issues/514
2022-12-21 12:15:46 +01:00
Jonathan Moore
de8fc988df
Make DefaultPrompt configurable (#519)
* Add default prompt configuration
2022-12-01 13:58:01 +01:00
Reilly Wood
076ce6f7fc
Fix example in CONTRIBUTING.md (#517) 2022-11-23 16:54:38 -08:00
Stefan Holderbach
94031fa337
Use Box::default() in more places (#512)
Is considered a potential optimization:
https://nnethercote.github.io/perf-book/standard-library-types.html#box
2022-11-07 22:07:38 +01:00
Stefan Holderbach
a84601945e
Prepare the 0.14.0 release (#511) 2022-11-07 20:37:56 +01:00
perlindgren
cd2d263eb4
Custom validator and prompt code examples (#500)
* custom validator and prompt

* Split prompt and validator demo into two files

Also add info text when running

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-11-07 20:33:54 +01:00
Stefan Holderbach
431d2ab656
Fix the additional moves of normal mode hjkl (#510)
* Fix the additional moves of normal mode `hjkl`

Fixes nushell/nushell#6991

Allows using `l` to complete the history hint in normal mode

Support menu navigation with `hjkl` in vi normal mode

Adjusts tests

* Fix clippy

Parameter only used in recursion
2022-11-05 23:07:57 +01:00
Stefan Holderbach
307df231e1
Split the main example binary into examples (#506)
* Split the main example binary into examples

Separate fully featured demo from keybinding listing and event listener

Allows to make `gethostname` dev-dependency

* Clippy fix in examples
2022-10-30 21:41:13 +01:00
Stefan Holderbach
f2ee704642
Update workflow to new actions (alternative) (#505)
Alternative to #503

Using `actions-rust-lang` instead of `actions-rs` for
setup. (nushell uses them for setup with integrated caching)

Remove build stage as this should also be covered by test.
clippy --all to see if this checks the examples as well.
2022-10-30 17:05:24 +01:00
Jan Christian Grünhage
698f4eb428
fix: actually use sqlite-dynlib feature (#504)
7d721a1 introduced the sqlite-dynlib feature, but using it in places
where sqlite is currently used was not possible, because the cfg gates
weren't adjusted yet. This commit replaces each `feature = "sqlite"`
with `any(feature = "sqlite",feature = "sqlite-dynlib")`, meaning that
it doesn't matter which sqlite feature you use, reedline will expose the
same API.
2022-10-30 16:09:53 +01:00
nibon7
39e6bc8eb3
show right prompt on indicator line in last line mode (#501) 2022-10-23 15:57:24 +02:00
Dan Davison
30713abe87
Tab inline completion (#498)
* On backspace, deactivate menu and do not complete

Fixes #5497

* Make Tab insert (partial) completion instead of select next menu item

* Fix history search filtering
2022-10-22 22:52:11 +02:00