1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/crates/printer
Andrew Gallant 91afd4214a printer: fix duplicative replacement in multiline mode
This furthers our kludge of dealing with PCRE2's look-around in the
printer. Because of our bad abstraction boundaries, we added a kludge to
deal with PCRE2 look-around by extending the bytes we search by a fixed
amount to hopefully permit any look-around to operate. But because of
that kludge, we wind up over extending ourselves in some cases and
dragging along those extra bytes.

We had fixed this for simple searching by simply rejecting any matches
past the end point. But we didn't do the same for replacements. So this
commit extends our kludge to replacements.

Thanks to @sonohgong for diagnosing the problem and proposing a fix. I
mostly went with their solution, but adding the new replacement routine
as an internal helper rather than a new APIn in the 'grep-matcher'
crate.

Fixes #2095, Fixes #2208
2022-05-11 14:44:58 -04:00
..
src printer: fix duplicative replacement in multiline mode 2022-05-11 14:44:58 -04:00
Cargo.toml cargo: use SPDX license format for all crates 2022-05-09 07:52:11 -04:00
LICENSE-MIT repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00
README.md edition: manual changes 2021-06-01 21:07:37 -04:00
UNLICENSE repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00

grep-printer

Print results from line oriented searching in a human readable, aggregate or JSON Lines format.

Build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/grep-printer

NOTE: You probably don't want to use this crate directly. Instead, you should prefer the facade defined in the grep crate.

Usage

Add this to your Cargo.toml:

[dependencies]
grep-printer = "0.1"