Permalink
Browse files

Fixed alignment of open variant types

  • Loading branch information...
1 parent c43476b commit f09064b317267117b69ead72bf9f1b996bc8a8db @AltGr AltGr committed Mar 27, 2013
Showing with 11 additions and 399 deletions.
  1. +9 −0 src/indentBlock.ml
  2. +0 −43 tests/failing-output/variants.ml
  3. +2 −356 tests/failing.html
  4. 0 tests/{failing → passing}/variants.ml
View
@@ -966,6 +966,15 @@ let rec update_path config t stream tok =
(* type =\nA\n| B : append a virtual bar before A for alignment *)
let path = append (KBar KType) L ~pad:2 t.path
in atom path
+ | {k=KBracket} as br::({k=KBody KType; line}::_ as p)
+ when starts_line ->
+ (* type = [\n`A\n| `B ]: append a virtual bar before `A *)
+ let path =
+ if br.line > line then {br with pad = 0} :: p
+ else t.path
+ in
+ let path = append (KBar KType) L ~pad:2 path
+ in atom path
| _ -> atom t.path)
| INT64 _ | INT32 _ | INT _ | LIDENT _
@@ -1,43 +0,0 @@
-type t = [ `aaa
- | `bbb
- | `ccc
- ]
-
-type t = [ `aaa | `bbb
- | `ccc
- ]
-
-type t =
- [ `aaa
- | `bbb
- | `ccc
- ]
-
-type t =
- [ `aaa | `bbb
- | `ccc
- ]
-
-type t =
- [
- `aaa
- | `bbb
- | `ccc
- ]
-
-type t =
- [
- `aaa | `bbb
- | `ccc
- ]
-
-type t = [
- `aaa
-| `bbb
-| `ccc
-]
-
-type t = [
- `aaa | `bbb
- | `ccc
-]
Oops, something went wrong.

0 comments on commit f09064b

Please sign in to comment.