Commit Graph

38 Commits

Author SHA1 Message Date
Stefan Holderbach
0bf57feba3
Update motto title (#640)
This should reflect that we do not strive to be a `readline` replacement and have our own opinionated choices.
2023-09-28 14:34:01 +02:00
Stefan Holderbach
ae1d97a384
Add a configuration to codecov.io (#636)
* Add a configuration to codecov.io

* Add badge

* Make coverage purely informational
2023-09-15 11:15:02 +02:00
Stefan Holderbach
3d83306b2d
Fix the Github actions badge (#523) 2022-12-21 13:00:50 +01: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
Jan Christian Grünhage
7d721a10e8
Don't bundle sqlite by default (#474)
* Don't bundle sqlite by default

* Split feature into `sqlite` & `sqlite-dynlib`

Also add feature documentation

* Copy feature doc to `lib.rs`

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-09-18 14:17:34 +02:00
morzel85
d4ab1a753f
README.md outline cleanup (#466)
- Fixed anchor links (some links were not pointing to correct headings).
- Updated headings (some headings in outline didn't match the content).
- Fixed heading level for "Integrate with History" (was 2 should be 3).
2022-08-22 10:06:33 +02:00
petrisch
28514478e3
Typo (#429)
Reedline has now... instead of Nushell has now...
2022-05-23 15:25:03 +02:00
Stefan Holderbach
3aaa776858
Fix README and lib.rs code examples (#419)
- Fix README and lib.rs code examples
  - Add missing doctests
  - Fix the completion example in README
  - Fix the edit mode example
- Try to run more of the doctests
  - They should not block with the IO loop or do file IO as this was failing the CI
2022-05-02 14:23:01 +02:00
Stefan Holderbach
23cbd8a74b
Fix the ci badge (#415) 2022-05-01 20:04:16 +02:00
Stefan Holderbach
2e2bdc5462
Add better options for screen clearing (#400)
- Remove the `Signal::CtrlL` as it requires explicit handling and
cooperation but we offer configurable keybindings already
- Default keybinding of `Ctrl-l` is `ReedlineEvent::ClearScreen` that
directly performs the scrollback buffer preserving clear of the current
screen.
- Add `ReedlineEvent::ClearScrollback` to perform screen clearing with
removal of the scrollback buffer. (Demo will now do that on clear as
seen in bash, zsh etc.)

Fixes #120

Helps with nushell/nushell#5089
2022-04-20 10:10:58 +02:00
Stefan Holderbach
1bf273d6e5
Clean up some stuff found by pedantic clippy (#394)
e.g.

- make modifying, non-returning functions more obvious by `;`
termination.
- merge match arms where it improves legibility
2022-04-11 17:58:36 +02:00
Michael Angerman
ad6015a19a
fix example in readme (#387) 2022-04-06 12:35:41 -07:00
Stefan Holderbach
60386ac610
API break: remove unnecessary fallibility (#367)
The fallible std::io::Results were originally introduced for the history
file but the critical points are completely separated from the builder
pattern now.

Makes the public API nicer
2022-03-31 23:32:31 +02:00
Waleed Dahshan
0216c84aa2
Fix the first example so it can be run (#371)
The example in the read me doesn't actually run until you add a return value for propagating io results.
2022-03-29 13:21:54 +02:00
Stefan Holderbach
2eea8fa66a
Update developer focussed documentation (#351)
* Update developer focussed documentation

- CONTRIBUTING guide
- Update Readme and lib.rs
- remove old checklist
2022-03-16 23:39:08 +01:00
Stefan Holderbach
8a8dd44aad
Small fix to document need to configure completion (#325)
Keybindings are currently configured to require the completion menu. To
use the completions you have to manually add it.

Undocumented: Changing the keybindings to use the old bash style
completions with `CircularCompletionHandler`

Track #307
2022-02-24 20:41:45 +01:00
Stefan Holderbach
d10a2e7bcb
Remove outdated CompletionActionHandler(s) (#270)
* Remove outdated ListCompletionActionHandler

The implementation is incompatible with the line estimation of the
painter and superseded by the selection supporting menu.

* Internalize Completer and the related UI

- Remove the `CompletionActionHandler` trait
- Make a single `Completer` member of the `Reedline` engine
- Provide a `CircularCompletionHandler` in the engine

Open question: How to manage configuration, whether circular completions
or the interactive completion menu are preferred

* Rename `ContextMenu` to `CompletionMenu`

Clarifies the exact purpose
2022-01-27 15:43:24 +01:00
Stefan Holderbach
52675664d2
Distill DefaultHinter down to history suggestions (#265)
* Show content after cursor when completing

Currently the content after the cursor was completely omitted when
entering the completion menu

Addresses it for the simple case of everything fitting on the screen

Question what should take priority if the entry and menu together exceed
the hight of the screen remains open!

* Place the hint obligatory behind the line content

In line with the behavior in fish and zsh autosuggestions hints are
displayed after the line.

Next step would be to make the DefaultHinter/Hinter trait conformant to
this behavior and also allow history hint suggestions based on the whole
line content, while editing inside the line.

* Simplify hinter internals/capabilities

DefaultHinter now only supports history

Requires no copies of the whole history anymore

* Remove `HistoryCompleter` (was never pub)

* Fix doctest `Reedline::with_hinter`

* Add configurable character threshold for Hinter

Only hint if a certain number of characters has been typed

Default: 1
2022-01-21 05:25:40 +11:00
Stefan Holderbach
a2682b50f9
Improve and highlight history search (#234)
Fixes `history_search_paint`:
- Fix unnecessary clear of single line
- Ensure LF to CRLF in search results

Fixes `Painter`:
- Make sure that Color is cleared after prompt (Currently depends on
Highlighter to provide a new color)
- Remove unnecessary fn

Introduce simple highlighting of the search term in the search result:
- Introduce `SingleMatchHighlighter` that will highlight all matches of
the search string
- Rename `DefaultHighlighter` to `ExampleHightlighter` as the behavior
seems not very useful for default use.
- Extract styling operations into styled text
2022-01-02 20:26:30 +01:00
Stefan Holderbach
adc6b1f649
Attempt at consolidating offset calculations and streamlining the painting (#164)
* Offset setting changes

* Rename `PromptWidget` to `PromptCoordinates`
* Explicit setters
* Set offset implicitly on `full_repaint`

* Rename origin and offset

As suggested by JT

origin -> prompt_start

offset -> input_start

* Move tracking of offsets and size into painter

Relatively basic refactor of all tracking of prompt/input offsets as
well as the terminal size into the painter.

Some cooperative behavior in the engine is still required

Wrapping handler is currently still a crutch in the engine as it is not
`InsertChar` specific and should be handled for every buffer change
instead

* Simplify restore from history stearch

Prompt is simply updated via full repaint

* Fix ansi coloring for history prompt

also ignore reset color in non ansi colored mode

* Make pedantic clippy happier

* Ensure prompt creation is tight and not wrapping

Fix additional line that is created upon prompt creation if the previous
output was printing a new line. Also ensures that line clearing and
regular prompt creation at the bottom of the screen doesn't cause
scrolling issues (Currently a hardcoded solution for the two line
prompt)

Also reduces the API surface for tools only necessary to deal within raw
mode.

* Fix doctests for internals removal

`print_crlf()` was removed from the public API as it should only be used
in raw mode for internal stuff.
As soon as we leave `Reedline.read_line()` raw mode should be disabled
and the regular print macros should work as expected
2021-12-22 23:14:58 +01:00
JT
88bded3417
Add list style completions (#162) 2021-10-05 10:32:21 +13:00
Stefan Holderbach
2ecda6e681
Fix README badges (#161)
Account for the move to the nushell org
2021-10-04 09:07:03 +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
aebbc24188
Modularization of the main struct (#134)
* Remove vagueness from position method

* Pull terminal size into the main struct

* WIP: prompt widget

* Remove a bunch of stuff

- clock
- vi stuff
- requirement to do full repaint state management

* Remove edit mode from event matcher

* Extract out event handling into a function

* Add reedline specific enum

* Rebase fixes

* Update docs

* Re-add clock functionality

* Add event-parser

* Pull out Input Parsing out of the main struct

* Move input parsing stuff into a directory

* Move vi stuff into input parsing

* Re-introduce Vi-Mode

* Remove EditMode enum

* Emacs mode uses non-default keybindings

* Basic hygine for edit_mode

- Rename: input_parsing to edit_mode
- Rename: EmacsInputParser to Emacs
- Rename: ViInputParser to Vi
- Rename: InputParser to EditMode
- Add docs: EditMode
- Add docs: Vi
- Add docs: Emacs

* Remove update_keybindings interface

* Vi sends Repaint events on mode switch

* Rename new to create
2021-08-29 06:10:16 +12:00
JT
1caf34339d
Add more rustdoc comments (#124)
* Add more rustdoc comments

* Add more rustdoc comments
2021-07-26 16:24:02 +12:00
JT
d8d8947735
Update README.md 2021-07-26 08:43:01 +12:00
JT
a69f95b47b
Update README.md 2021-07-26 08:42:10 +12:00
Stefan Holderbach
db9722e5f3
Fix eclectic docs (#106)
* Fix eclectic docs

* Make `cargo doc` happy again
* Let the `lib.rs` doc test a few constructor examples.
* Fix badges and repo links in the README

* Make the badges linkout

* Fix typo
2021-07-19 06:05:54 +12:00
Marco Zanrosso
6f2344271e
[StyleFix][Update] Documentation (#104)
* [Update] lib.rs with latest improvements

* [Update] readme.md with latest improvements
2021-07-17 01:40:38 +02:00
JT
4433bfc309
Update README.md 2021-06-17 14:29:10 +12:00
JT
c8d00d1acd
Add vi mode (#57) 2021-06-15 11:03:57 +12:00
Stefan Holderbach
725779728c
Various proposed refactors (#54)
* Small refactors, doctest for History search walk

* Reset History cursor on append() automatically

* Split off the enums from engine.rs
2021-06-14 18:35:40 +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
Jonathan Turner
236b6e0c09
Update README.md 2021-02-28 22:45:43 +13:00
Jonathan Turner
99b84142d2
Update README.md 2021-02-28 22:45:28 +13:00
Jonathan Turner
85d4627b7d
Update README.md 2021-02-28 22:45:18 +13:00
Jonathan Turner
2b6fdbfa65
Initial commit 2021-02-28 22:42:07 +13:00