-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestion: added style #691
Conversation
Personally, I'd love to see "style" added. You can't get colorful enough for me. |
@rsteube |
i assume, rsteube is the owner of carapace and this pull request comes from a carapace issue relating nushell. |
Yes, An additional attribute in the results similar to the config should work: https://github.com/nushell/nushell/blob/main/crates/nu-cli/src/reedline_config.rs#L162 let style = match text {
Value::String { val, .. } => lookup_ansi_color_style(&val),
Value::Record { .. } => color_record_to_nustyle(&text),
_ => None
}; |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
==========================================
+ Coverage 47.59% 49.28% +1.68%
==========================================
Files 47 46 -1
Lines 9312 8009 -1303
==========================================
- Hits 4432 3947 -485
+ Misses 4880 4062 -818
|
7cfac29
to
c2bf6c5
Compare
You can test this with nushell/nushell#11442 and the current master branch of carapace-bin: cd cmd/carapace
go generate ./...
go install |
@rsteube I now have carapace installed and we are ready continue working on this PR.... The CI is reporting one failing check having to do with the spelling of "wheres" which should be "whereas" Also you will probably need to update your code somewhat as the branch has conflicts... Thank you ! |
supports reverse highlighting using nu.config ```nushell style: { text: white selected_text: { attr: r } description_text: white_dimmed } ```
I think you just need to merge main because we added wheres a while back Line 13 in 7d08fc8
|
949bf1f
to
27bf852
Compare
@rsteube thanks for getting this going so quickly today and being very patient for a long time... Glad we were finally able to land this PR --- sorry it took so long 😄 |
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description Adds style support. Reverse highlighting is recommended for the [completion-menu](https://www.nushell.sh/book/line_editor.html#completion-menu): ```nushell style: { text: white selected_text: { attr: r } description_text: white_dimmed } ``` needs nushell/reedline#691 related #5292 fix carapace-sh/carapace#967 <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> # User-Facing Changes Style support for values during completion: ![image](https://github.com/nushell/nushell/assets/9090290/f5e4440e-61db-4eeb-87b3-f887b6918c50) ![image](https://github.com/nushell/nushell/assets/9090290/e59065a6-58c2-4f5f-82ea-e2b9c2464b9a) <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
* get correct cursor pos when menu indicator contains newline * add tests * fix cursor pos in multiline prompt * make description mode enum public * add doc comment * respect windows newline in update_values * Revert "respect windows newline in update_values" This reverts commit 070d600. * add complete_with_base_ranges to Completer * add builder for correct_cursor_pos * add config options to completion examples * add style to ide menu * run fmt * start menu refactor * Revert "start menu refactor" This reverts commit 62726f2.
<!-- if this PR closes one or more issues, you can automatically link the PR with them by using one of the [*linking keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), e.g. - this PR should close #xxxx - fixes #xxxx you can also mention related issues, PRs or discussions! --> # Description Adds style support. Reverse highlighting is recommended for the [completion-menu](https://www.nushell.sh/book/line_editor.html#completion-menu): ```nushell style: { text: white selected_text: { attr: r } description_text: white_dimmed } ``` needs nushell/reedline#691 related nushell#5292 fix carapace-sh/carapace#967 <!-- Thank you for improving Nushell. Please, check our [contributing guide](../CONTRIBUTING.md) and talk to the core team before making major changes. Description of your pull request goes here. **Provide examples and/or screenshots** if your changes affect the user experience. --> # User-Facing Changes Style support for values during completion: ![image](https://github.com/nushell/nushell/assets/9090290/f5e4440e-61db-4eeb-87b3-f887b6918c50) ![image](https://github.com/nushell/nushell/assets/9090290/e59065a6-58c2-4f5f-82ea-e2b9c2464b9a) <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
Reverse highlighting with config "record" for reverse:
related nushell/nushell#5292
related carapace-sh/carapace#546