diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | parsing/location.ml | 18 |
2 files changed, 10 insertions, 9 deletions
@@ -51,6 +51,7 @@ Runtime system: point within the major heap. Bug fixes: +- PR#3679: Warning display problems - PR#3963: Graphics.wait_next_event in Win32 hangs if window closed - PR#4762: ?? is not used at all, but registered as a lexer token - PR#4887: input_char after close_in crashes ocaml (msvc runtime) diff --git a/parsing/location.ml b/parsing/location.ml index 4d6449ded..d4562e6d2 100644 --- a/parsing/location.ml +++ b/parsing/location.ml @@ -137,17 +137,17 @@ let highlight_dumb ppf lb loc = if !line = !line_start && !line = !line_end then (* loc is on one line: print whole line *) Format.pp_print_char ppf c - else if !line = !line_start then + else if !line = !line_start then begin (* first line of multiline loc: print ... before loc_start *) - if pos < loc.loc_start.pos_cnum - then Format.pp_print_char ppf '.' - else Format.pp_print_char ppf c - else if !line = !line_end then + if pos = loc.loc_start.pos_cnum then + Format.pp_print_string ppf "..."; + Format.pp_print_char ppf c + end else if !line = !line_end then begin (* last line of multiline loc: print ... after loc_end *) - if pos < loc.loc_end.pos_cnum - then Format.pp_print_char ppf c - else Format.pp_print_char ppf '.' - else if !line > !line_start && !line < !line_end then + Format.pp_print_char ppf c; + if pos = loc.loc_end.pos_cnum then + Format.pp_print_string ppf "..."; + end else if !line > !line_start && !line < !line_end then (* intermediate line of multiline loc: print whole line *) Format.pp_print_char ppf c end else begin |