Fix additional indentation bug for let-in

pull/279/head
Lennart Spitzner 2020-01-10 16:32:18 +01:00
parent af227a797d
commit 2b303b2a20
3 changed files with 19 additions and 1 deletions

View File

@ -782,3 +782,19 @@ func = abc + def
where
abc = 13
def = 1
#test AddBaseY/EnsureIndent float in effect
zItazySunefp twgq nlyo lwojjoBiecao =
let mhIarjyai =
ukwAausnfcn
$ XojlsTOSR.vuwOvuvdAZUOJaa
$ XojlsTOSR.vkesForanLiufjeDI
$ XojlsTOSR.vkesForanLiufjeDI
$ XojlsTOSR.popjAyijoWarueeP
$ XojlsTOSR.jpwuPmafuDqlbkt nlyo
$ XojlsTOSR.jpwuPmafuDqlbkt xxneswWhxwng
$ XojlsTOSR.jpwuPmafuDqlbkt oloCuxeDdow
$ XojlsTOSR.jpwuPmafuDqlbkt (uwurrvoNnukzefuDjeh lwojjoBiecao nlyo)
$ etOslnoz lwojjoBiecao
in kucotg $ (bbbr, Yoxe.Dwzbuzi.zrLokoTnuy piv)

View File

@ -770,7 +770,7 @@ layoutExpr lexpr@(L _ expr) = do
addAlternativeCond (not hasComments) $ docSeq
[ appSep $ docLit $ Text.pack "let"
, docNodeAnnKW lexpr (Just AnnLet)
$ appSep $ docForceSingleline bindDoc
$ appSep $ docForceSingleline bindDoc
, appSep $ docLit $ Text.pack "in"
, docForceSingleline expDoc1
]

View File

@ -132,6 +132,8 @@ transformSimplifyFloating = stepBO .> stepFull
Just $ BDIndentLevelPop (BDAddBaseY ind x)
BDAddBaseY ind (BDIndentLevelPushCur x) ->
Just $ BDIndentLevelPushCur (BDAddBaseY ind x)
BDAddBaseY ind (BDEnsureIndent ind2 x) ->
Just $ BDEnsureIndent (mergeIndents ind ind2) x
_ -> Nothing
stepBO :: BriDoc -> BriDoc
stepBO = -- traceFunctionWith "stepBO" (show . briDocToDocWithAnns) (show . briDocToDocWithAnns) $