Commit Graph

2769 Commits

Author SHA1 Message Date
Jakub Žádník
9b99b2f6ac
Overlays (#5375)
* WIP: Start laying overlays

* Rename Overlay->Module; Start adding overlay

* Revamp adding overlay

* Add overlay add tests; Disable debug print

* Fix overlay add; Add overlay remove

* Add overlay remove tests

* Add missing overlay remove file

* Add overlay list command

* (WIP?) Enable overlays for env vars

* Move OverlayFrames to ScopeFrames

* (WIP) Move everything to overlays only

ScopeFrame contains nothing but overlays now

* Fix predecls

* Fix wrong overlay id translation and aliases

* Fix broken env lookup logic

* Remove TODOs

* Add overlay add + remove for environment

* Add a few overlay tests; Fix overlay add name

* Some cleanup; Fix overlay add/remove names

* Clippy

* Fmt

* Remove walls of comments

* List overlays from stack; Add debugging flag

Currently, the engine state ordering is somehow broken.

* Fix (?) overlay list test

* Fix tests on Windows

* Fix activated overlay ordering

* Check for active overlays equality in overlay list

This removes the -p flag: Either both parser and engine will have the
same overlays, or the command will fail.

* Add merging on overlay remove

* Change help message and comment

* Add some remove-merge/discard tests

* (WIP) Track removed overlays properly

* Clippy; Fmt

* Fix getting last overlay; Fix predecls in overlays

* Remove merging; Fix re-add overwriting stuff

Also some error message tweaks.

* Fix overlay error in the engine

* Update variable_completions.rs

* Adds flags and optional arguments to view-source (#5446)

* added flags and optional arguments to view-source

* removed redundant code

* removed redundant code

* fmt

* fix bug in shell_integration (#5450)

* fix bug in shell_integration

* add some comments

* enable cd to work with directory abbreviations (#5452)

* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable

* make cd recornize symblic link (#5454)

* implement seq char command to generate single character sequence (#5453)

* add tmp code

* add seq char command

* Add split number flag in `split row` (#5434)

Signed-off-by: Yuheng Su <gipsyh.icu@gmail.com>

* Add two more overlay tests

* Add ModuleId to OverlayFrame

* Fix env conversion accidentally activating overlay

It activated overlay from permanent state prematurely which would
cause `overlay add` to misbehave.

* Remove unused parameter; Add overlay list test

* Remove added traces

* Add overlay commands examples

* Modify TODO

* Fix $nu.scope iteration

* Disallow removing default overlay

* Refactor some parser errors

* Remove last overlay if no argument

* Diversify overlay examples

* Make it possible to update overlay's module

In case the origin module updates, the overlay add loads the new module,
makes it overlay's origin and applies the changes. Before, it was
impossible to update the overlay if the module changed.

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
Co-authored-by: pwygab <88221256+merelymyself@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: WindSoilder <WindSoilder@outlook.com>
Co-authored-by: Yuheng Su <gipsyh.icu@gmail.com>
2022-05-08 07:39:22 +12:00
Fernando Herrera
1cb449b2d1
Database commands (#5466)
* change query to statement

* internal functions and over definitions

* cargo fmt
2022-05-07 13:33:33 +01:00
WindSoilder
6cc66c8afd
complete some commands tests (#5464)
* complete hash test

* unignore source relative tests
2022-05-07 06:23:49 -05:00
Reilly Wood
08e495ea67
Enable string interpolation for environment shorthand (#5463) 2022-05-07 06:21:29 -05:00
Herlon Aguiar
b0647f780d
nu-cli/completions: send original line to custom completer (#5459) 2022-05-06 16:58:42 -05:00
Darren Schroeder
2dfd975940
add -n flag to print to print without a newline (#5458)
* add -n flag to print to print without a newline

* clippy
2022-05-06 15:33:00 -05:00
Yuheng Su
fbdb125141
Add split number flag in split row (#5434)
Signed-off-by: Yuheng Su <gipsyh.icu@gmail.com>
2022-05-06 10:53:02 -05:00
WindSoilder
c2ea993f7e
implement seq char command to generate single character sequence (#5453)
* add tmp code

* add seq char command
2022-05-06 10:40:02 -05:00
WindSoilder
e14e60dd2c
make cd recornize symblic link (#5454) 2022-05-06 10:39:48 -05:00
Darren Schroeder
768ff47d28
enable cd to work with directory abbreviations (#5452)
* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable
2022-05-06 07:58:32 -05:00
Darren Schroeder
78a1879e36
fix bug in shell_integration (#5450)
* fix bug in shell_integration

* add some comments
2022-05-05 10:10:03 -05:00
pwygab
0b9c0fea9d
Adds flags and optional arguments to view-source (#5446)
* added flags and optional arguments to view-source

* removed redundant code

* removed redundant code

* fmt
2022-05-05 06:37:56 -05:00
Tom
02a3430ef0
Use correct ParseError (#5431) 2022-05-05 07:41:32 +12:00
Darren Schroeder
6623ed9061
sometimes you want a text output (#5441) 2022-05-04 14:12:23 -05:00
pwygab
48cf103439
Allowed for view-source to include entire custom command definition (#5435)
* allowed for view-source to include entire custom command definition

* fmt

* clippy
2022-05-04 06:35:09 -05:00
JT
d306b834ca
Bump to 0.62 (#5422) 2022-05-04 09:01:27 +12:00
Stefan Holderbach
d4371438d1
Pin reedline to v0.5.0 for the next release (#5427)
Release notes: https://github.com/nushell/reedline/releases/tag/v0.5.0

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-05-04 08:11:31 +12:00
Fernando Herrera
6a972312d4
added open editor event in config parsing (#5426) 2022-05-04 07:52:53 +12:00
Maxim Zhiburt
ac48f5a318
Fix coloring when string has spaces (#5425)
* Replace ansi-cut with ansi-str

There's no issues with it we just need to use it later.

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Fix color losing in string spliting into Sublines

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-05-03 09:48:43 -05:00
JT
e36649f74b
Update path completions to handle spaces (#5419) 2022-05-03 12:37:38 +12:00
Fernando Herrera
1a52460695
Database commands (#5417)
* dabase access commands

* select expression

* select using expressions

* cargo fmt

* alias for database

* database where command

* expression operations

* and and or operators

* limit and sort by commands
2022-05-03 06:38:18 +12:00
Richard
ab98ecd55b
Fix erroneous removal of "./" folder prefix (#5416) 2022-05-02 12:36:18 -05:00
Yuheng Su
bb27b9f371
Don't resuggest accepted completions (#5369)
To avoid resuggesting the same completion, add a space after commands or flags that have been accepted via `Enter`. Don't do that for filepaths or external completions

* Add append_whitespace choice for suggestion

Signed-off-by: gipsyh <gipsyh.icu@gmail.com>

* Fixed `test <path>` appending space.

* Update reedline

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-05-02 11:35:37 +02:00
Stefan Holderbach
1ca3063ac3
Fix CI to run doctests again (#5410)
The faster `cargo nextest` currently doesn't support running the doctests.

Thus, add an additional step for them with cargo's default test runner.

- Fix doctests for the `nu-pretty-hex` crate
2022-05-02 11:32:57 +02:00
Yuheng Su
7c9a78d922
Fixed ctrl-c in recursion loop bug #5362 (#5409) 2022-05-02 20:18:25 +12:00
panicbit
49cbc30974
Add ends-with operator and fix dataframe operator behavior (#5395)
* add ends-with operator

* escape needles in dataframe operator regex patterns
2022-05-02 20:02:38 +12:00
Yuheng Su
07a7bb14bf
Fixed interrupting a for-loop over a list bug #5378 (#5408)
Signed-off-by: gipsyh <gipsyh.icu@gmail.com>
2022-05-02 19:56:37 +12:00
JT
4a69819f9a
Rename =^ to 'starts-with' (#5407) 2022-05-02 19:20:07 +12:00
JT
96f8691c8d
More escaping/unescaping fixes (#5403) 2022-05-02 09:49:31 +12:00
Reilly Wood
07255e576d
Add Miette "fancy" feature to fix plugin builds (#5402) 2022-05-02 08:52:49 +12:00
JT
14c9bd44ef
Adds error printing back in a couple places (#5400) 2022-05-02 08:40:46 +12:00
JT
92785ab92c
Add unescaping to external command parsing (#5399) 2022-05-02 07:26:29 +12:00
JT
98ab31e15e
Move uses of trim_quotes to unescape for filenames (#5398)
* Move uses of trim_quotes to unescape for filenames

* Fix Windows tests
2022-05-02 06:37:20 +12:00
Darren Schroeder
80d57d70cd
a little database cleanup (#5394) 2022-05-01 07:44:29 -05:00
Reilly Wood
5077242892
Error printing changes for watch (#5389)
* Move CliError to nu-protocol

clean up comment

* Enable printing errors instead of just returning them

* Nicer Miette error printing in watch command
2022-05-01 19:33:41 +12:00
Andrés N. Robalino
7a7aa310aa
Remove 'empty' block support reminders, for now. (#5214) 2022-04-30 22:32:30 -05:00
Richard
07893e01c1
Remove "./" prefix for file path completions (#5387) 2022-04-30 16:54:04 -05:00
JT
f16401152b
Make if else more lazy (#5386) 2022-05-01 09:13:21 +12:00
Herlon Aguiar
3df03e2e6d
nu-cli/completions: complete external args as filepath (#5385) 2022-05-01 08:07:09 +12:00
Herlon Aguiar
7c6f976d65
nu-cli/completions: apply correctly nesting for env vars (#5382) 2022-04-30 14:14:04 -05:00
Tomoki Aonuma
ae9c0fc138
Fix quoting for command line args (#5384)
* Fix quoting for command line args

* Replace custom quoting with escape_quote_string

* Use raw string for now
2022-04-30 13:23:05 -05:00
Fernando Herrera
9da2e142b2
Line buffer editor (#5381)
* allow line editing

* cargo fmt
2022-04-30 15:40:41 +01:00
Darren Schroeder
5999506f87
allows for nushell to have tables without the index column (#5380) 2022-04-30 09:07:46 -05:00
Darren Schroeder
2659ea3dbd
Revert "nu-cli/completions: better fix for files with special characters (#5254)" (#5372)
This reverts commit 3cf3329e49.
2022-04-29 13:11:41 -05:00
Tomoki Aonuma
fa27110651
Avoid using time conversion methods that may panic (#5365) 2022-04-29 06:03:39 -05:00
Michael Angerman
8e5cc655e9
cleanup version command and add in database feature (#5356)
* cleanup version command and add in database feature

* static-link-openssl
2022-04-28 15:25:04 -05:00
Jonathan Moore
f189369fd7
Change description of sort (#5355) 2022-04-28 14:33:26 -05:00
Reilly Wood
f2d7454330
Add watch command (#5331) 2022-04-28 09:26:34 -05:00
Herlon Aguiar
3cf3329e49
nu-cli/completions: better fix for files with special characters (#5254)
* nu-cli/completions: fix paths with special chars

* add backticks

* fix replace

* added single quotes to check list

* check escape using fold

* fix clippy errors

* fix comment line

* fix conflicts

* change to vec

* skip sort checking

* removed invalid windows path

* remove comment

* added tests for escape function

* fix fn import

* fix fn import error

* test windows issue fix

* fix windows backslash path in the tests

* show expected path on error

* skip test for windows
2022-04-28 08:36:32 -05:00
Michael Angerman
4ec4649903
mute false import warning for nu-command test where_ (#5350) 2022-04-27 22:45:39 -07:00