OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
200 stars 63 forks source link

indentation for double try ... with -> try ... with -> #201

Closed william3 closed 9 years ago

william3 commented 9 years ago

ocp 1.5.1, with default params for with (0) and strict_with (never) I get this indentation :

let _ =
  let () = (* ok *)
    match foo with
    | "hello" -> true
    | "boy" -> true
  in
  let () = (* ok *)
    try
      true
    with _ ->
      true
  in
  let () = (* not ok *)
    try
      true
    with _ ->
    try
      true
    with _ ->
      true

while it would seem more appropriate to have :

let _ =
  let () =
    match foo with
    | "hello" -> true
    | "boy" -> true
  in
  let () =
    try
      true
    with _ ->
      true
  in
  let () =
    try
      true
    with _ ->
      try
        true
      with _ ->
        true

Best regards

AltGr commented 9 years ago

This is intended, see 158dd2cf6da4abd56a1eb52bb5848073a38b6081