File tree 4 files changed +28
-43
lines changed
build_tests/super_errors/expected
4 files changed +28
-43
lines changed Original file line number Diff line number Diff line change 4
4
5
5
1 [2m│[0m /* overflows in the terminal */
6
6
[1;31m2[0m [2m│[0m let a: int = [1;31m"hellllllllllllllllllllllllllllllllllllllllllllllllllllllll[0m
7
- [1;31mlllllllllllllllllllllllllll";[0m
7
+ [2m│[0m [1;31mlllllllllllllllllllllllllll";[0m
8
8
3 [2m│[0m
9
9
10
10
This has type: [1;31mstring[0m
Original file line number Diff line number Diff line change @@ -238,20 +238,15 @@ let print ~is_warning ~src ~startPos ~endPos =
238
238
Buffer. add_string buf (col NoColor " \n " );
239
239
| Number line_number -> begin
240
240
content |> List. iteri (fun i line ->
241
- if i = 0 then begin
242
- let gutter_color =
243
- if i = 0
244
- && line_number > = highlight_line_start_line
245
- && line_number < = highlight_line_end_line then
246
- if is_warning then Warn else Err
247
- else NoColor
248
- in
249
- draw_gutter gutter_color (string_of_int line_number);
250
- end else begin
251
- (* TODO: remove this branch after the next PR *)
252
- let pad = String. make (max_line_digits_count + indent + 3 ) ' ' in
253
- Buffer. add_string buf (col NoColor pad);
254
- end ;
241
+ let gutter_content = if i = 0 then string_of_int line_number else " " in
242
+ let gutter_color =
243
+ if i = 0
244
+ && line_number > = highlight_line_start_line
245
+ && line_number < = highlight_line_end_line then
246
+ if is_warning then Warn else Err
247
+ else NoColor
248
+ in
249
+ draw_gutter gutter_color gutter_content;
255
250
256
251
line.s |> String. iteri (fun ii ch ->
257
252
let c =
Original file line number Diff line number Diff line change @@ -407653,20 +407653,15 @@ let print ~is_warning ~src ~startPos ~endPos =
407653
407653
Buffer.add_string buf (col NoColor "\n");
407654
407654
| Number line_number -> begin
407655
407655
content |> List.iteri (fun i line ->
407656
- if i = 0 then begin
407657
- let gutter_color =
407658
- if i = 0
407659
- && line_number >= highlight_line_start_line
407660
- && line_number <= highlight_line_end_line then
407661
- if is_warning then Warn else Err
407662
- else NoColor
407663
- in
407664
- draw_gutter gutter_color (string_of_int line_number);
407665
- end else begin
407666
- (* TODO: remove this branch after the next PR *)
407667
- let pad = String.make (max_line_digits_count + indent + 3) ' ' in
407668
- Buffer.add_string buf (col NoColor pad);
407669
- end;
407656
+ let gutter_content = if i = 0 then string_of_int line_number else "" in
407657
+ let gutter_color =
407658
+ if i = 0
407659
+ && line_number >= highlight_line_start_line
407660
+ && line_number <= highlight_line_end_line then
407661
+ if is_warning then Warn else Err
407662
+ else NoColor
407663
+ in
407664
+ draw_gutter gutter_color gutter_content;
407670
407665
407671
407666
line.s |> String.iteri (fun ii ch ->
407672
407667
let c =
Original file line number Diff line number Diff line change @@ -433704,20 +433704,15 @@ let print ~is_warning ~src ~startPos ~endPos =
433704
433704
Buffer.add_string buf (col NoColor "\n");
433705
433705
| Number line_number -> begin
433706
433706
content |> List.iteri (fun i line ->
433707
- if i = 0 then begin
433708
- let gutter_color =
433709
- if i = 0
433710
- && line_number >= highlight_line_start_line
433711
- && line_number <= highlight_line_end_line then
433712
- if is_warning then Warn else Err
433713
- else NoColor
433714
- in
433715
- draw_gutter gutter_color (string_of_int line_number);
433716
- end else begin
433717
- (* TODO: remove this branch after the next PR *)
433718
- let pad = String.make (max_line_digits_count + indent + 3) ' ' in
433719
- Buffer.add_string buf (col NoColor pad);
433720
- end;
433707
+ let gutter_content = if i = 0 then string_of_int line_number else "" in
433708
+ let gutter_color =
433709
+ if i = 0
433710
+ && line_number >= highlight_line_start_line
433711
+ && line_number <= highlight_line_end_line then
433712
+ if is_warning then Warn else Err
433713
+ else NoColor
433714
+ in
433715
+ draw_gutter gutter_color gutter_content;
433721
433716
433722
433717
line.s |> String.iteri (fun ii ch ->
433723
433718
let c =
You can’t perform that action at this time.
0 commit comments