Commit Graph

404 Commits

Author SHA1 Message Date
Fernando Herrera
698190c534
generic reedline menus (#378)
* generic reedline menus

* change word in description

* correct tests in examples

* corrected menu names

* renamed menu

* option for menus to take full line buffer

* corrected list menu insertion
2022-04-04 11:04:57 +01:00
Fernando Herrera
accce4af7f
bashisms feature for reedline (#374)
* bashisms feature for reedline

* cargo fmt
2022-04-01 18:27:51 +01:00
Fernando Herrera
246706c971
format descriptions to the left (#375) 2022-04-01 18:27:41 +01: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
Stefan Holderbach
0f92985c69
Expose the history as syncable and readable (#373)
Useful for nushell repl loop lifting
2022-03-30 22:11:49 +02:00
Sherub Thakur
5240130c9f
Edit stack (#368)
* Add edit stack

* Use edit stack in the core editor

* Edit stack is just a struct

* Test undo-redo behaviour instead of implementation details
2022-03-29 18:17:51 +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
Fernando Herrera
bc18ba3260
corrects menu selection (#369) 2022-03-28 07:37:48 +01:00
Tomoki Aonuma
7b5e761c8e
Fix menu::menu_functions::string_difference (#364) 2022-03-27 13:34:11 +01:00
Fernando Herrera
072f961107
Vim normal keybingings (#365)
* corrected normal keybindings and caps

* insert checks first for mode

* vi parser test
2022-03-27 13:24:17 +01:00
Tomoki Aonuma
7c594b16ba
Fix menu::menu_functions::find_common_string (#363)
* Fix `menu::menu_functions::find_common_string`

* Add test for `DefaultCompleter`

* Add test strings
2022-03-27 11:46:57 +01:00
Fernando Herrera
e982abf7e2
update history menu (#362) 2022-03-27 08:47:40 +01:00
Fernando Herrera
69fad67b90
Descriptions for completion suggestions (#358)
* add description to completion suggestions

* completion menu with help

* corrected doc tests

* moved menu functions to module

* menu type with its own completer

* corrected doc tests

* function for menus to quick complete
2022-03-27 08:30:08 +01:00
Darren Schroeder
bc528de132
bump to 0.3.1 and nu-ansi-term to 0.45.1 (#361) 2022-03-27 15:42:39 +13:00
Jonathan Moore
2e0d35187c
fix typo [skip ci] (#355) 2022-03-25 10:04:38 +13:00
Jacob Rothstein
0ecf800f22
end/control-e selects the current completion (#354) 2022-03-23 23:16:30 +01:00
Jacob Rothstein
bf66f2e103
add missing alt-f for parity with the existing alt-b (#353) 2022-03-23 22:55:09 +01:00
Stefan Holderbach
c0543b875c
Prepare for new release (#352)
- Update dependencies
- Increase version number to 0.3.0
2022-03-16 23:58:25 +01: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
sholderbach
7802d85475 Simplify insertion_point in LineBuffer
- Remove the usize wrapping type `InsertionPoint`
- Remove redundant functions returning the same result
2022-03-14 20:56:14 +01:00
sholderbach
dcabfb1990 Improve visibility and documentation of internals
Painter is currently leaked by `Menu` trait. Thus document the safe part
that is used for this implementation.
Also define the responsibility of editor
2022-03-14 20:56:14 +01:00
sholderbach
8ff0147927 Folderize validator 2022-03-14 20:56:14 +01:00
sholderbach
56ea39ec32 Folderize hinter 2022-03-14 20:56:14 +01:00
sholderbach
804f31d181 Folderize prompt
- Fix docs for Prompt trait
- Separate trait and default implementation
- Hide constants that are of little use
2022-03-14 20:56:14 +01:00
sholderbach
ebafcdfe20 Create utils folder 2022-03-14 20:56:14 +01:00
sholderbach
5bc9d6c747 Folderize painting code
- Move painter and styled_text into a common folder
- Separate out `PromptLines` and freestanding utility functions
2022-03-14 20:56:14 +01:00
sholderbach
ad4760e476 Remove painter debug output 2022-03-14 20:56:14 +01:00
sholderbach
2d44337324 Update UX checklist
Remove tests that are now well covered internally.

TODO: update expectations for the completions and hints as well as vi
mode
2022-03-14 20:56:14 +01:00
sholderbach
efbbd2f766 Pedantic clippy and code style polish
- Terminate with semicolon, where return type `()`
- Invert some conditionals for readability
- `match` to `if let` if binary
- pass by value vs by reference
- `must_use` attribute where applicable (builder patterns)
- make internal `Mode` enum explicitly `ViMode`
- Docstring fixes
- Format explicit identifiers in docs
2022-03-14 20:56:14 +01:00
sholderbach
4416270877 Distill DefaultPrompt impl
Unnecessary redirection in the codebase removed
2022-03-14 20:56:14 +01:00
sholderbach
de49cdaf4e Use quick_completions in the demo app
Reflects the defaults from nushell.
2022-03-14 20:56:14 +01:00
sholderbach
28e74b4ebc Remove draft file for syntax highlighting 2022-03-14 20:56:14 +01:00
Fernando Herrera
4e5a20d127
backward history bang (#344) 2022-03-12 09:26:51 +00:00
Fernando Herrera
87a32d5147
History menu pages (#342)
* history menu page error

* checking before update

* remove in_edit variable

* remove redundant none
2022-03-10 19:05:24 +00:00
Fernando Herrera
f60bbb2939
history menu page error (#341) 2022-03-10 12:03:43 +00:00
Fernando Herrera
e1767338eb
can complete case insensitive (#340) 2022-03-08 08:03:27 +00:00
Fernando Herrera
5cd2fa2655
space before bang (#338) 2022-03-07 17:24:02 +00:00
Fernando Herrera
56bc4a00bb
Space required before bang (#337)
* bang command expands only alone in buffer

* bang command requires space before
2022-03-07 17:11:12 +00:00
Fernando Herrera
8394b62f3d
bang command expands only alone in buffer (#336) 2022-03-07 16:42:19 +00:00
Fernando Herrera
0d6e26276a
menu partial completions to menu function (#335) 2022-03-06 16:34:56 +00:00
Fernando Herrera
7c5f20d252
History improved (#334)
* undo for history replace

* history improvements

* replaced history comment
2022-03-05 19:27:50 -05:00
Fernando Herrera
3209848ddb
history bang (#333) 2022-03-05 08:53:54 +00:00
Fernando Herrera
e75a3c340a
update values after common string (#332) 2022-03-04 17:24:19 +00:00
Fernando Herrera
75489c02b4
Partial completions (#331)
* partial completions

* cargo fmt

* avoid extra partial completion
2022-03-03 09:48:05 +00:00
Fernando Herrera
e9c1e37d7c
partial completions for menu (#330)
* partial completions

* cargo fmt
2022-03-03 08:43:11 +00:00
JT
3d933d52ce
Better crossterm fix (#329)
* Move to crossterm on git

* Better fix for crossterm
2022-03-01 06:32:14 -05:00
JT
470b20129d
Move to crossterm on git (#328) 2022-03-01 05:41:23 -05:00
Stefan Holderbach
e314e8491e
Revert crossterm: key modifier issue on win (#326)
crossterm 0.23 seems to have introduce a regression on windows for
decoding keybindings with `ctrl` that uppercases the char.

Tracking issue crossterm-rs/crossterm#636

Might be fixed by crossterm-rs/crossterm#629
2022-02-26 14:51:38 +01:00
Stefan Holderbach
97230d73bc
Provide cursor position for highlighting (#324)
Changes the `Highlighter` trait to include the position of the cursor in
the buffer. This allows it to make cursor aware highlighting such as
highlighting matching braces or code blocks

Prerequisite to address nushell/nushell#4325
2022-02-26 14:51:16 +01:00
Stefan Holderbach
bb7179cd9c
Use chars in str::replace where applicable (#327)
Fixes ci fail due to new clippy lint in rust 1.59
2022-02-26 14:17:30 +01:00