Hi, I am new to this repo so feel free to let me know if there is any way I can improve this PR. As detailed in the liked issue, this functionality is useful for quite a few cases where search/replace type tooling is built around ripgrep. My own neovim plugin is an example of a tool built on top of your great work 😄 : https://github.com/MagicDuck/grug-far.nvim
This change would allow me to show diffs, a much requested feature.
Example:
Given the following text in file /home/andrew/sherlock:
For the Doctor Watsons of this world, as opposed to the Sherlock
Holmeses, success in the province of detective work must always
Searching for Watson with a replacement parameter of Moriarity, here's what a match type item would looks like:
{
"type": "match",
"data": {
"path": {"text": "/home/andrew/sherlock"},
"lines": {"text": "For the Doctor Watsons of this world, as opposed to the Sherlock\n"},
"line_number": 1,
"absolute_offset": 0,
"submatches": [
{"match": {"text": "Watson"}, "replacement": {"text": "Moriarity"}, "start": 15, "end": 21}
]
}
}
fixes https://github.com/BurntSushi/ripgrep/issues/1872
Hi, I am new to this repo so feel free to let me know if there is any way I can improve this PR. As detailed in the liked issue, this functionality is useful for quite a few cases where search/replace type tooling is built around ripgrep. My own neovim plugin is an example of a tool built on top of your great work 😄 : https://github.com/MagicDuck/grug-far.nvim This change would allow me to show diffs, a much requested feature.
Example:
Given the following text in file
/home/andrew/sherlock
:Searching for
Watson
with a replacement parameter ofMoriarity
, here's what a match type item would looks like:P.S. Your documentation in code is amazing!