Skip to content

Commit fdea972

Browse files
committed
doc: clarify a case where -m/--max-count is not strictly respected
In #2843, it's requested that these trailing contextual lines should be displayed as non-matching because they exceed the limit. While reasonable, I think that: 1. This would be a weird complication to the implementation. 2. This would overall be less intuitive and more complex. Today, there is never a case where ripgrep emits a matching line in a way where the match isn't highlighted. Closes #2843
1 parent c45ec16 commit fdea972

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/core/flags/defs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,6 +3898,10 @@ When \flag{multiline} is used, a single match that spans multiple lines is only
38983898
counted once for the purposes of this limit. Multiple matches in a single line
38993899
are counted only once, as they would be in non-multiline mode.
39003900
.sp
3901+
When combined with \flag{after-context} or \flag{context}, it's possible for
3902+
more matches than the maximum to be printed if contextual lines contain a
3903+
match.
3904+
.sp
39013905
Note that \fB0\fP is a legal value but not likely to be useful. When used,
39023906
ripgrep won't search anything.
39033907
"

0 commit comments

Comments
 (0)