-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
empty pattern doesn't display utf8 #937
Comments
Initially, I couldn't reproduce this:
On a hunch, I tried a different terminal emulator (specifically,
So that did the trick. The specific problem here is that you're searching with an empty pattern, which matches at every position, even between UTF-8 code units. I suspect this itself might actually be a bug in the regex engine. A simple fix on ripgrep's side of things would be to simply not emit color escapes for zero width matches, since those color escapes aren't visually observable by humans. This would fix things because the reason why you're seeing bad output is presumably because there is a color escape sequence between UTF-8 code units, and your terminal emulator chokes on it. However, some folks are using ripgrep's color escapes to determine match locations, so I don't think I can make that change until ripgrep has a structured output feature. So, you're pretty much stuck with this behavior for now. You might re-visit why it is you're feeding an empty pattern to ripgrep if you're looking for a workaround. |
I filed a bug against the regex engine. Fixing that would also fix this bug. rust-lang/regex#484 |
This commit updates the CHANGELOG to reflect all the work done to make libripgrep a reality. * Closes #162 (libripgrep) * Closes #176 (multiline search) * Closes #188 (opt-in PCRE2 support) * Closes #244 (JSON output) * Closes #416 (Windows CRLF support) * Closes #917 (trim prefix whitespace) * Closes #993 (add --null-data flag) * Closes #997 (--passthru works with --replace) * Fixes #2 (memory maps and context handling work) * Fixes #200 (ripgrep stops when pipe is closed) * Fixes #389 (more intuitive `-w/--word-regexp`) * Fixes #643 (detection of stdin on Windows is better) * Fixes #441, Fixes #690, Fixes #980 (empty matching lines are weird) * Fixes #764 (coalesce color escapes) * Fixes #922 (memory maps failing is no big deal) * Fixes #937 (color escapes no longer used for empty matches) * Fixes #940 (--passthru does not impact exit status) * Fixes #1013 (show runtime CPU features in --version output)
This commit updates the CHANGELOG to reflect all the work done to make libripgrep a reality. * Closes #162 (libripgrep) * Closes #176 (multiline search) * Closes #188 (opt-in PCRE2 support) * Closes #244 (JSON output) * Closes #416 (Windows CRLF support) * Closes #917 (trim prefix whitespace) * Closes #993 (add --null-data flag) * Closes #997 (--passthru works with --replace) * Fixes #2 (memory maps and context handling work) * Fixes #200 (ripgrep stops when pipe is closed) * Fixes #389 (more intuitive `-w/--word-regexp`) * Fixes #643 (detection of stdin on Windows is better) * Fixes #441, Fixes #690, Fixes #980 (empty matching lines are weird) * Fixes #764 (coalesce color escapes) * Fixes #922 (memory maps failing is no big deal) * Fixes #937 (color escapes no longer used for empty matches) * Fixes #940 (--passthru does not impact exit status) * Fixes #1013 (show runtime CPU features in --version output)
What version of ripgrep are you using?
ripgrep 0.8.1
-SIMD -AVX
How did you install ripgrep?
cargo install ripgrep -f
What operating system are you using ripgrep on?
Linux Debian 9.
Describe your question, feature request, or bug.
On empty patterns utf8 strings aren't presented with the correct encode.
If this is a bug, what are the steps to reproduce the behavior?
Or with any utf8 content.
lotabout/skim#83
If this is a bug, what is the actual behavior?
Doesn't display correctly on empty patterns
If this is a bug, what is the expected behavior?
Display always like when has a pattern match.
Thanks!
The text was updated successfully, but these errors were encountered: