- 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).
- 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
- 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
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
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
* 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
* 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
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
* 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
* 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
* 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
* 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