-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add key selector argument to replace (#74)
this adds a `-s`/`--key-selector` argument to the `replace` command. in non-regexp mode, it will specify a complete key to match against. in regexp mode, if the key selector yields any matches it will be considered be successful. in this case, replacements will be evaluated against that key-value pair. this pull also fixes two issues: - improper evaluation of the add/remove markup on a line diff during replace - indexes being generated for regexps (index+length) did not match the indexes being generated for substrings (start&end) resulting in a panic for matches longer than half the string
- Loading branch information
Showing
5 changed files
with
105 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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