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

Bizarre indentation with nested List.fold_left(s) #222

Closed iguerNL closed 8 years ago

iguerNL commented 8 years ago

These two examples are not well indented by ocp-indent 1.5.3 (with OCaml 4.02.3).

let f l =
  List.fold_left
    (fun acc l ->
       List.fold_left
     (fun acc
    e ->
    assert false
  ) acc l
    ) [] l
let f l =
  List.fold_left
    (fun acc l ->
       List.fold_left
     (fun acc e ->
    assert false
  ) acc l
    ) [] l
AltGr commented 8 years ago

Here is what I get:

let f l =
  List.fold_left
    (fun acc l ->
      List.fold_left
        (fun acc
          e ->
            assert false
        ) acc l
    ) [] l

let f l =
  List.fold_left
    (fun acc l ->
      List.fold_left
        (fun acc e ->
          assert false
        ) acc l
    ) [] l

It looks ok to me ?

iguerNL commented 8 years ago

with which version ?

AltGr commented 8 years ago

1.5.3, but there shouldn't be any significative changes with recent versions on this example. Maybe make sure your file doesn't contain tabs ?

iguerNL commented 8 years ago

Ah ! I have a tab in the indentation :-/