Add spaces around record braces (single-line) (fixes #126)
parent
ef7b0fcc70
commit
bdee27cb59
|
@ -749,8 +749,8 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
then return Nothing
|
then return Nothing
|
||||||
else Just <$> docSharedWrapper layoutExpr fExpr
|
else Just <$> docSharedWrapper layoutExpr fExpr
|
||||||
return (fieldl, lrdrNameToText lnameF, fExpDoc)
|
return (fieldl, lrdrNameToText lnameF, fExpDoc)
|
||||||
let line1 appender wrapper =
|
let line1 wrapper =
|
||||||
[ appender $ docLit $ Text.pack "{"
|
[ appSep $ docLit $ Text.pack "{"
|
||||||
, docWrapNodePrior fd1l $ appSep $ docLit fd1n
|
, docWrapNodePrior fd1l $ appSep $ docLit fd1n
|
||||||
, case fd1e of
|
, case fd1e of
|
||||||
Just x -> docSeq
|
Just x -> docSeq
|
||||||
|
@ -776,8 +776,9 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
docAlt
|
docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
$ [docNodeAnnKW lexpr Nothing nameDoc, docSeparator]
|
$ [docNodeAnnKW lexpr Nothing nameDoc, docSeparator]
|
||||||
++ line1 id docForceSingleline
|
++ line1 docForceSingleline
|
||||||
++ join (lineR docForceSingleline)
|
++ join (lineR docForceSingleline)
|
||||||
|
++ [docSeparator]
|
||||||
++ lineN
|
++ lineN
|
||||||
, docSetParSpacing
|
, docSetParSpacing
|
||||||
$ docAddBaseY BrIndentRegular
|
$ docAddBaseY BrIndentRegular
|
||||||
|
@ -785,7 +786,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
(docNodeAnnKW lexpr Nothing nameDoc)
|
(docNodeAnnKW lexpr Nothing nameDoc)
|
||||||
( docNonBottomSpacing
|
( docNonBottomSpacing
|
||||||
$ docLines
|
$ docLines
|
||||||
$ [docCols ColRecUpdate $ line1 appSep (docAddBaseY BrIndentRegular)]
|
$ [docCols ColRecUpdate $ line1 (docAddBaseY BrIndentRegular)]
|
||||||
++ (docCols ColRecUpdate <$> lineR (docAddBaseY BrIndentRegular))
|
++ (docCols ColRecUpdate <$> lineR (docAddBaseY BrIndentRegular))
|
||||||
++ [docSeq lineN]
|
++ [docSeq lineN]
|
||||||
)
|
)
|
||||||
|
@ -800,8 +801,8 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
then return Nothing
|
then return Nothing
|
||||||
else Just <$> docSharedWrapper layoutExpr fExpr
|
else Just <$> docSharedWrapper layoutExpr fExpr
|
||||||
return (fieldl, lrdrNameToText lnameF, fExpDoc)
|
return (fieldl, lrdrNameToText lnameF, fExpDoc)
|
||||||
let line1 appender wrapper =
|
let line1 wrapper =
|
||||||
[ appender $ docLit $ Text.pack "{"
|
[ appSep $ docLit $ Text.pack "{"
|
||||||
, docWrapNodePrior fd1l $ appSep $ docLit fd1n
|
, docWrapNodePrior fd1l $ appSep $ docLit fd1n
|
||||||
, case fd1e of
|
, case fd1e of
|
||||||
Just x -> docSeq
|
Just x -> docSeq
|
||||||
|
@ -831,9 +832,10 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
docAlt
|
docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
$ [docNodeAnnKW lexpr Nothing nameDoc, docSeparator]
|
$ [docNodeAnnKW lexpr Nothing nameDoc, docSeparator]
|
||||||
++ line1 id docForceSingleline
|
++ line1 docForceSingleline
|
||||||
++ join (lineR docForceSingleline)
|
++ join (lineR docForceSingleline)
|
||||||
++ lineDot
|
++ lineDot
|
||||||
|
++ [docSeparator]
|
||||||
++ lineN
|
++ lineN
|
||||||
, docSetParSpacing
|
, docSetParSpacing
|
||||||
$ docAddBaseY BrIndentRegular
|
$ docAddBaseY BrIndentRegular
|
||||||
|
@ -841,7 +843,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
(docNodeAnnKW lexpr Nothing nameDoc)
|
(docNodeAnnKW lexpr Nothing nameDoc)
|
||||||
( docNonBottomSpacing
|
( docNonBottomSpacing
|
||||||
$ docLines
|
$ docLines
|
||||||
$ [docCols ColRecUpdate $ line1 appSep (docAddBaseY BrIndentRegular)]
|
$ [docCols ColRecUpdate $ line1 (docAddBaseY BrIndentRegular)]
|
||||||
++ (docCols ColRecUpdate <$> lineR (docAddBaseY BrIndentRegular))
|
++ (docCols ColRecUpdate <$> lineR (docAddBaseY BrIndentRegular))
|
||||||
++ [docSeq lineDot, docSeq lineN]
|
++ [docSeq lineDot, docSeq lineN]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue