Implement "str replace" with closure defined relacements#16854
Merged
Conversation
Contributor
|
Thanks |
fdncred
pushed a commit
that referenced
this pull request
Nov 10, 2025
Thanks to #16854, I added highlighting to the `std/help` like with the default `help` in #15892. It does the same of using `nu-highlight`, italics and in case of invalid syntax italics + dimmed. While I was at it I added `ansi` as a search term for `config use-colors` to make it easier to find and while searching for an `fn search_terms` example I found out that in `to_uppercase.rs` the search terms where all a single string so I fixed that too. ~~TODO: it seems that the types like `list<string>` are highlighted in this but not with the default help.~~ ## Release notes summary - What our users need to know <!-- This section will be included as part of our release notes. See the contributing guide for more details. Please include only details relevant for users here. Motivation and technical details can be added above or below this section. You may leave this section blank until your PR is finalized. Ask a core team member if you need help filling this section. --> Similar to the default `help`, now `std/help` will highlight code in between backticks in the descriptions. Example: <img width="1068" height="333" alt="image" src="https://github.com/user-attachments/assets/fef0b2db-0e78-4473-b540-6bf617e7fb6d" /> ## Tasks after submitting <!-- Remove any tasks which aren't relevant for your PR, or add your own -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16544
Release notes summary - What our users need to know
str replacenow accepts a closure that computes the replacement value for each matchTasks after submitting