-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
bugA bug.A bug.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.
Description
See the discussion below. It seems to me like --trim should run before applying the max column length.
I say this without re-contextualizing myself with the code. There may be a reason for the current behavior that I'm forgetting.
Discussed in #2456
Originally posted by misaki-web March 15, 2023
Is there a way to make ripgrep apply the --trim flag before reducing the line length with --max-columns-preview -M?
Here's an example of the current result (the string starts with 5 spaces):
$ echo " 0123456789abcdefghijklmnopqrstuvwxyz" | rg --trim --max-columns-preview -M 8 abc
012 [... 1 more match]ripgrep reduces the line length, then it trims it. I expected the opposite, like this:
$ echo " 0123456789abcdefghijklmnopqrstuvwxyz" | rg --trim --max-columns-preview -M 8 abc
01234567 [... 1 more match]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugA bug.A bug.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.