summaryrefslogtreecommitdiffstats
path: root/complete
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-04-13 18:35:24 -0400
committerAndrew Gallant <jamslam@gmail.com>2019-04-14 19:29:27 -0400
commitece1f50cfe49fea324d96f97a2ae00ebbd0cad03 (patch)
tree8615570232a16f572702619333b446a0a530772c /complete
parenta7d26c8f144a4957b75f71087a66692d0b25759a (diff)
printer: support previews for long lines
This commit adds support for showing a preview of long lines. While the default still remains as completely suppressing the entire line, this new functionality will show the first N graphemes of a matching line, including the number of matches that are suppressed. This was unfortunately a fairly invasive change to the printer that required a bit of refactoring. On the bright side, the single line and multi-line coloring are now more unified than they were before. Closes #1078
Diffstat (limited to 'complete')
-rw-r--r--complete/_rg4
1 files changed, 4 insertions, 0 deletions
diff --git a/complete/_rg b/complete/_rg
index 882a38d6..6c2ee2bb 100644
--- a/complete/_rg
+++ b/complete/_rg
@@ -148,6 +148,10 @@ _rg() {
$no"--no-crlf[don't use CRLF as line terminator]"
'(text)--null-data[use NUL as line terminator]'
+ + '(max-column-preview)' # max column preview options
+ '--max-column-preview[show preview for long lines (with -M)]'
+ $no"--no-max-column-preview[don't show preview for long lines (with -M)]"
+
+ '(max-depth)' # Directory-depth options
'--max-depth=[specify max number of directories to descend]:number of directories'
'!--maxdepth=:number of directories'