* Remove completion code from help/value shells
* Tweak the `Completer` trait for nushell.
Previously, this trait was built around rustyline's completion traits, and for
`Shell` instances. Now it is built for individual completers inside of nushell
that will complete a specific location based on a partial string. For example,
for completing a partially typed command in the command position.
We introduce the `plugin` nu sub command (`nu plugin`) with basic plugin
loading support. We can choose to load plugins from a directory. Originally
introduced to make integration tests faster (by not loading any plugins on startup at all)
but `nu plugin --load some_path ; test_pipeline_that_uses_plugins_just_loaded` does not see it.
Therefore, a `nu_with_plugins!` macro for tests was introduced on top of nu`s `--skip-plugins`
switch executable which is set to true when running the integration tests that use the `nu!` macro now..
* Implement exclusive and inclusive ranges with .. and ..=
This commit adds right-exclusive ranges.
The original a..b inclusive syntax was changed to reflect the Rust notation.
New a..=b syntax was introduced to have the old behavior.
Currently, both a.. and b..= is valid, and it is unclear whether it's valid
to impose restrictions.
The original issue suggests .. for inclusive and ..< for exclusive ranges,
this can be implemented by making simple changes to this commit.
* Fix collect tests by changing ranges to ..=
* Fix clippy lints in exclusive range matching
* Implement exclusive ranges using `..<`
Previously, we weren't expanding `~`, so `std::fs::metadata` was failing. We now
make use of `PathSuggestion` to get the actual path, as represented by a
`PathBuf`.
* remove unused dependencies
* moved umask to cfg(unix)
* changed Inflector to inflector, hoping it fixes the issue.
* roll back Inflector
* removed commented out deps now that everything looks good.
* First commit updating `config` to use subcommands (#2119)
- Implemented `get` subcommand
* Implmented `config set` as a subcommand.
* Implemented `config set_into` as subcommand
* Fixed base `config` command
- Instead of outputting help, it now outputs the list of all
configuration parameters.
* Added `config clear` subcommand
* Added `config load` and `config remove` subcommands
* Added `config path` subcommand
* fixed clippy
* initial commit for implementing groups
* each group works
* each group is slightly cleaner + added example
* Added `each window` subcommand
- No support for stride flag yet
* each window stride implemented
* Added tests and minor documentation changes
* fixed clippy
* fixed clippy again
Previously, we'd check for a `~/` prefix and then return the home directory as
the base `PathBuf`. We failed to consider pushing any of the other possible path
components into this base dir, which prevent completions more than one level
deep (for example, `~/.config/<TAB>` would fail).
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* clean up some comments
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* added weather symbols/chars
Although convenient, since the user doesn't have to type the space, it could be
a little surprising to users since they may think that was the only completion
in certain completions modes (for example, `cycle`).
* fixed: .*.(ext|*)
* ls **/* does not return hidden files without the -a flag
* fixed formatting
* fixed clippy issues
* fixed clippy issues, v2
* added `#[cfg(unix)]` to windows-failing test
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* ensure ansi mode is enabled on windows
ansi mode sometimes gets out of sync in Windows.
I'm not sure why but this appears to fix it.
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* shouldn't these both bet clipboard-cli?
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* fixed bug where no config.toml or not set settings made weird defaults.
* clippy & fmt again
* Header default alignment is left.
Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* merges
* some info on how to set colors
* WIP - compiling but not working
* semi-working
* making progress
* working except for table lines
* fmt + clippy
* cleaned up some comments
* working line colors
* fmt, clippy, updated sample config.toml
* removed extra comments
* Use the cursor position for the span when between locations.
This fixes a bug where completing
ls <TAB>
would result in replacing the entire line.
* Revert to the default update implementation.
Replacing the length of the elected value was intended to do replacement when
one moves inside a quote. The problem is that a long elected suggestion could
replace bits of a pipeline that are after the cursor. For example:
ls <TAB> | get name | str collect
We ensure the partially cimpleted item doesn't include the end quote. We also
ensure that the appropriate span is replaced, not just the suggested position up
to the cursor position.