Fix wherespecial with indent/=2 (fixes #39)

pull/51/head
Lennart Spitzner 2017-08-05 16:09:46 +02:00
parent 6da000f872
commit ccb59ef803
1 changed files with 9 additions and 3 deletions

View File

@ -215,12 +215,18 @@ layoutPatternBindFinal alignmentToken binderDoc mPatDoc clauseDocs mWhereDocs ha
patPartParWrap = case mPatDoc of patPartParWrap = case mPatDoc of
Nothing -> id Nothing -> id
Just patDoc -> docPar (return patDoc) Just patDoc -> docPar (return patDoc)
whereIndent <- whereIndent <- do
mAsk shouldSpecial <- mAsk
<&> _conf_layout <&> _conf_layout
.> _lconfig_indentWhereSpecial .> _lconfig_indentWhereSpecial
.> confUnpack .> confUnpack
.> Bool.bool BrIndentRegular (BrIndentSpecial 1) regularIndentAmount <- mAsk
<&> _conf_layout
.> _lconfig_indentAmount
.> confUnpack
pure $ if shouldSpecial
then BrIndentSpecial (max 1 (regularIndentAmount `div` 2))
else BrIndentRegular
-- TODO: apart from this, there probably are more nodes below which could -- TODO: apart from this, there probably are more nodes below which could
-- be shared between alternatives. -- be shared between alternatives.
wherePartMultiLine :: [ToBriDocM BriDocNumbered] <- case mWhereDocs of wherePartMultiLine :: [ToBriDocM BriDocNumbered] <- case mWhereDocs of