Commit Graph

433 Commits

Author SHA1 Message Date
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
Carl Schierig
da27f0041a
change cursor shape depending on edit mode (#494) 2022-10-21 09:03:53 +02:00
nibon7
8e1511ad05
render right prompt on the last line of the left prompt (#492)
* render right prompt on the last line of the left prompt

Closes nushell/nushell#4909

* make rendering the right prompt on the last line configurable

* calculate width of the line where right prompt will be rendered
2022-10-20 21:57:01 +02:00
Stefan Holderbach
21f5e125de
Prepare 0.13 release (#495) 2022-10-17 23:00:38 +02:00
Stefan Holderbach
5061d2288c
Fix completion example in README/lib.rs (#497)
Adapted from examples added in #493
2022-10-16 23:41:57 +02:00
Stefan Holderbach
c08ce5ef7f
Fix examples in README based on lib.rs (#496)
The first two README examples became rotten and were out of sync with
the doctested version from the `lib.rs`
2022-10-16 23:20:35 +02:00
Paul Colomiets
f949f560f7
Add Submit and SubmitOrNewline editor events (#490)
* `Submit` is used to return data unconditionally. This is useful for
  example if you want compiler to show you where the unclosed paren that
  doesn't pass validation actually is.
* `SubmitOrNewline` is similar to `Enter` but inserts a new line if the
  cursor is not at the end of the buffer. It's useful to insert newlines
  in the middle of the text when editing.

This also removes unconditional `KeyCode::Enter` to
`ReedlineEvent::Enter` event mapping and sets it in the keybindings
normally (so you can rebind to `Submit` or `SubmitOrNewline`)
2022-10-16 22:24:08 +02:00
perlindgren
835d2e9f25
examples updated (#493)
Puts the minimal examples from the documentation as separate example executables to play around with
2022-10-16 22:13:55 +02:00
Paul Colomiets
3042289df4
Remove flicker on external print (#488)
* Remove flicker on external print

Previously each external print was causing a visible flicker on at least
two terminal emulators I've tested (alacritty, xfce4-terminal).

* Make `Painter.print_external_message()` crate local

* Put external_printer Painter members behind flag

* Add `external_printer` feature to CI

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2022-09-29 16:36:04 +02:00
Stefan Holderbach
f994cc9d38
Prepare 0.12.0 release (#487)
* Prepare 0.12.0 release

* Widen author metadata
2022-09-28 12:00:54 +13:00
sholderbach
3e92f97da2 Parse motions properly, fix #449, add combinations (#484)
This change truly separates the actions and the motions on the parsing
side. Bare motions are parsed by the motion parser instead of the
command parser. (This requires a separate `ParseResult` to distinguish
valid but incomplete motions like `f` from invalid motions.)

Fixes #449 by making `.` its own command. Also introduces the
possibility of multiplying the `.` repeat and resticts its effect to the
action commands and ignores the bare moves.

Simplify and make the `;` and `,` behavior more correct:
- Place info in the `Vi` state instead of complicated in-band signal
- Support using it with `d;` and `c;`
- Store the character search when combined with an action
- Rename `ViToTill` more explictly to `ViCharSearch`
- **Missing:** the old tests were removed as they tested old quirks

The above change also leads to proper separation of concern between
parsing and translation to emacs commands (and subsequent execution).

Add support for combining `d/c` with `h/l`.
**Note:** `j/k` are still omitted as they require new behavior in the
linebuffer/editor. Also `dj` has to add 1 to the multiplier to achieve
the correct behavior as we do not model line ex-/inclusive behavior.

Rename `ParseResult` to `ParsedViSequence`

Simplify validity checking in `mod.rs` and have explicit check methods
on the types. This fixes problems with `r` and `f/t/T/F` in their
partial and complete state and adds a missing test.

Rename `last_to_till` to `last_char_search`
2022-09-25 23:55:58 +02:00
sholderbach
07a9a7463f Add tests for cut_right_until_char (#484)
I discovered a limitation in how we handle character searches with a
multiplier in the case the search character appears in a consecutive
sequence.
Fixing this correctly probably requires performing the search with
knowledge of the multiplier.
2022-09-25 23:55:58 +02:00
sholderbach
26a09b7a54 Simplify application of multiplier (#484)
Take into account that only the product of the `multiplier` and `count`
are relevant to execute motions.

From 140f6d0eda/runtime/doc/motion.txt (L63-L70)

> If the motion includes a count and the operator also had a count before it,
> the two counts are multiplied.  For example: "2d3w" deletes six words.
> When doubling the operator it operates on a line.  When using a count, before
> or after the first character, that many lines are operated upon.  Thus `3dd`
> deletes three lines. A count before and after the first character is
> multiplied, thus `2y3y` yanks six lines.
2022-09-25 23:55:58 +02:00
sholderbach
a7dababdd0 Make the c action translation more explicit (#484)
Move the `Repaint` addition outside to ensure it is always added.
Currently required to detect the mode change visually.
2022-09-25 23:55:58 +02:00