Support for Shift-AltGr is required for several European keyboards (e.g. italian) #169#136#139#171
* Curly braces fix
* Curly braces fix for vim events
Co-authored-by: Antonio Natilla <antonio.natilla@studenti.unimi.it>
* Introduced 'repaint' flag on struct ReedLine, and associated builder function
* Added builder to configure and disable idle animations
* Ran `cargo fmt` and `cargo clippy`
* [BugFix] undo function
This commit solves the problem that when the undo function is performed,
for some reason the buffer remained with 1 character.
The FIX consists in correcting the logic of the current implementation
by bringing it to the initial design state; Where the vector of the
buffer had been initialized with an empty entry so that when performing
many times the undo brought you back to an initial condition with
the blank buffer rather than show you the first character.
* [Add] doc-test for set_previous_lines
This test was created specifically to check that the insertion
of characters and words in the Editor.edits vector works properly.
* Replace doctest with unittest
This does not require exposing private functionality as pub
* Fix naming according to #160
Co-authored-by: sholderbach <ho.steve@web.de>
* Fix CtrlD/CtrlC and reverse-history-search + stuff
- `Ctrl+C` and `Ctrl+D` did not work after the changes in #138 and #146
- Fixed by only registering the `ReedlineEvent` and defering
potentially necessary edits to the `handle_event` stage
- Defined their behavior for the reverse history search
- Corrected interactions with undo (as best as I could understand it)
- Reverse history search did not allow for browsing through its results
- Fixed `handle_history_search_event` and simplified the cases
- Register undo steps for the reverse history search (when entering and
leaving via enter)
- Added comments to similar sounding methods and variants (UPDATE IF
NECESSARY!)
- Moved the repaint stuff closer together in engine.rs for better
readability
- Noncritical stuff that caught my eye
* Test first/last line detection
* Ignore tarpaulin coverage build folder and html report
* Add tests for line buffer
* Capitalize char only moves a character to right
* Uppercasing and lowercasing words works
* Fix the swap grapheme function
I have made this to be close to what I inferred the intent to be. I
really think we should probably have two functions which do this:
`swap_grapheme_left` and `swap_grapheme_right` which work in the
mentioned direction.
* Fix swap words
Swap words only swap words and there is no change in position.
* 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
* Extract hinter and highlighter out of Painter
* Cleanup unused variables, add comments
* Remove AppendToHistory Event
* Keybindings talk in terms of ReedlineEvent
* Add placeholder docs
* Push History handling one-level up
* Modify Enter handling to match others
* Extract Previous and Next History commands from EditCommand to ReedlineEvent
* Remove reduncant EditCommand -> ViFragment
* Pull Up/Down from EditCommand to ReedlineEvent
* Pull SearchHistory from EditCommand to ReedlineEvent
* Refactor insertion wrapping code
* Push History handling one more level up
* Fix doc test: keybind interface change
* Remove redundant indirections
* Reorganize methods in engine
* Update vi binds from history to up/down operations
* Remove the hacky EditInsert brach from ReedlineEvent
* 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
* Organise tab handling into files
* Concretise assumptions as manul tests
* Add expectation (failing test)
* Store one-level history for tab handler
* Remove reset index from the public interface of TabCompletion
* Update note on cycling though the tab-completions
* Cleanup: Remove un-necessary indirections from engine to editor functions
* Cleanup: Remove dead code - partial_command
* Cleanup: Make undo/redo interface consistent with other editor functions
* Cleanup: abstract up/down command logic to appropriate units
* Add a core-editor folder
* Add editor
Currently this is more of less line_buffer the integration with engine
has a few hacky edges that need to taken care off.
* Pull cut buffer operations into editor
* [WIP] Fixing the history behavior
* Repaint mode switching after the 1sec case
* Back to history cursor with len for not used -> fixes the skipping the
most recent
* unit tests not yet adapted
* None logic not yet smart to be able to leave history traversal
* Rewriting history with JT
Fixing the basic traversal as well as the prefix based search.
Ctrl-R search still dysfunctional. Missing the duplicate detection, thus
not passing tests. Missing test coverage for moving forward in a search.
* Complete basic history test suite
* Test the forward behavior in prefix search
* Skip consecutive equal matches
* Fix Ctrl-R search
* Update file_backed.rs
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
* Cursor updates with the appropriate history command
* History command inserts after the end
we will most likely store multiline commands in history as `String`s so
I have opted for a converstion of this string to a vector separated by
newlines in `set_buffer`.
* History Traversal paining rules
- On normal up down we update the cursor to the end of the line
- On prefix based up and down we do not update the cursor
Rationale for this is that when we are doing prefix search a user might
want to add more to his query so as to get better prefix matching and
having to delete through all the chars we would otherwise fill in might
be annoying.
* Fix prefix search not updating properly
* Normal traversal sets history string at cursor to line buffer
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>