aboutsummaryrefslogtreecommitdiff
path: root/lib/grep.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-17 17:46:46 -0500
committerMarc Coquand <marc@mccd.space>2024-05-17 17:46:46 -0500
commit90f8c5e65c96f946ab079271b52112ec36d6c42c (patch)
treec84380eec69806e978039f1f64c993538c3a472d /lib/grep.ml
parentd5d547126c5fe2d0235b63e4ed964c4285bb2bfb (diff)
downloadstitch-90f8c5e65c96f946ab079271b52112ec36d6c42c.tar.gz
stitch-90f8c5e65c96f946ab079271b52112ec36d6c42c.tar.bz2
stitch-90f8c5e65c96f946ab079271b52112ec36d6c42c.zip
Resolve OOB error
Diffstat (limited to '')
-rw-r--r--lib/grep.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/grep.ml b/lib/grep.ml
index 2e55b40..5690edc 100644
--- a/lib/grep.ml
+++ b/lib/grep.ml
@@ -295,8 +295,9 @@ type display_type =
let pretty_print_parsed_content parsed_files =
let padding = String.make headline_pattern_length ' ' in
List.concat_map
- (fun (file_name, line_number, line_content, _) ->
+ (fun (file_name, line_number, line_content, file_number) ->
if line_number == 0
- then [ Bold ("--------- " ^ file_name); Normal line_content ]
- else [ Normal (padding ^ line_content) ])
+ then
+ [ file_number, Bold ("--------- " ^ file_name); file_number, Normal line_content ]
+ else [ file_number, Normal (padding ^ line_content) ])
parsed_files