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

Wrong indentation after attribute without payload #226

Closed smondet closed 5 years ago

smondet commented 8 years ago

Not sure whether it's related to https://github.com/OCamlPro/ocp-indent/issues/224.

When there is an attribute without payload, a big indent is added on the next line. When the attribute has an argument everything is normal.

(* Wrong: *)
type t = {
  a: int [@main];
        b : string;
}

(* Good: *)
type t = {
  a: int [@main ""];
  b : string;
}

([@main] comes from ppx_deriving.make).

AltGr commented 8 years ago

Can't reproduce: what version are you using ? Do you have any specific config (see ocp-indent --print-config)

smondet commented 8 years ago
 $ ocp-indent --version
1.5.3
 $ ocp-indent --print-config
base = 2
type = 2
in = 0
with = 0
match_clause = 2
ppx_stritem_ext = 2
max_indent = 4
strict_with = never
strict_else = always
strict_comments = false
align_ops = true
align_params = auto
smondet commented 8 years ago

Oh I also have within emacs: (setq ocp-indent-config "strict_with=always,with=0")