With a while form to search face 'rg-match-face and replace the region, it worked well In most scenarios, however when I use a regex which include "\n"(with option --multiline), the one matched result was highlighed seperated into two results. I guess it's because 'rg-match-face couldn't take effect on "\n" and when I use face to locate result, one result becomes two, my replacement failed.
for now, my solution for --multiline is to use query-replace-regexp to replace "\n" firstly, then use rg search and replace. Is there any other method to get matched result positions in the rg buffer ?
@dajva thanks for your great package ! I write a command to replace matched result with given string as following:
With a while form to search face 'rg-match-face and replace the region, it worked well In most scenarios, however when I use a regex which include "\n"(with option --multiline), the one matched result was highlighed seperated into two results. I guess it's because 'rg-match-face couldn't take effect on "\n" and when I use face to locate result, one result becomes two, my replacement failed.
for now, my solution for --multiline is to use
query-replace-regexp
to replace "\n" firstly, then use rg search and replace. Is there any other method to get matched result positions in the rg buffer ?