Fix EnsureIndent handling
parent
449d4b4787
commit
02ee54f806
|
@ -405,8 +405,25 @@ transformAlts briDoc
|
||||||
}
|
}
|
||||||
rec x
|
rec x
|
||||||
return $ reWrap $ BDFLines (l':lr')
|
return $ reWrap $ BDFLines (l':lr')
|
||||||
BDFEnsureIndent indent bd ->
|
BDFEnsureIndent indent bd -> do
|
||||||
reWrap . BDFEnsureIndent indent <$> rec bd
|
acp <- mGet
|
||||||
|
indAmount <- mAsk <&> _conf_layout .> _lconfig_indentAmount .> runIdentity
|
||||||
|
let indAdd = case indent of
|
||||||
|
BrIndentNone -> 0
|
||||||
|
BrIndentRegular -> indAmount
|
||||||
|
BrIndentSpecial i -> i
|
||||||
|
mSet $ acp { _acp_indentPrep = 0 -- TODO: i am not sure this is valid,
|
||||||
|
-- in general.
|
||||||
|
, _acp_indent = _acp_indent acp + indAdd
|
||||||
|
, _acp_line = _acp_line acp + indAdd
|
||||||
|
}
|
||||||
|
r <- rec bd
|
||||||
|
acp' <- mGet
|
||||||
|
mSet $ acp' { _acp_indent = _acp_indent acp }
|
||||||
|
return $ case indent of
|
||||||
|
BrIndentNone -> r
|
||||||
|
BrIndentRegular -> reWrap $ BDFEnsureIndent (BrIndentSpecial indAdd) r
|
||||||
|
BrIndentSpecial i -> reWrap $ BDFEnsureIndent (BrIndentSpecial i) r
|
||||||
BDFNonBottomSpacing bd -> rec bd
|
BDFNonBottomSpacing bd -> rec bd
|
||||||
BDFSetParSpacing bd -> rec bd
|
BDFSetParSpacing bd -> rec bd
|
||||||
BDFForceParSpacing bd -> rec bd
|
BDFForceParSpacing bd -> rec bd
|
||||||
|
@ -963,8 +980,8 @@ transformSimplifyFloating = stepBO .> stepFull
|
||||||
-- Just $ BDCols sig (BDEnsureIndent indent col : (BDAddBaseY indent <$> colr))
|
-- Just $ BDCols sig (BDEnsureIndent indent col : (BDAddBaseY indent <$> colr))
|
||||||
-- not sure if the following rule is necessary; tests currently are
|
-- not sure if the following rule is necessary; tests currently are
|
||||||
-- unaffected.
|
-- unaffected.
|
||||||
BDEnsureIndent indent (BDLines lines) ->
|
-- BDEnsureIndent indent (BDLines lines) ->
|
||||||
Just $ BDLines $ BDEnsureIndent indent <$> lines
|
-- Just $ BDLines $ BDEnsureIndent indent <$> lines
|
||||||
-- post floating in
|
-- post floating in
|
||||||
BDAnnotationPost annKey1 (BDPar ind line indented) ->
|
BDAnnotationPost annKey1 (BDPar ind line indented) ->
|
||||||
Just $ BDPar ind line $ BDAnnotationPost annKey1 indented
|
Just $ BDPar ind line $ BDAnnotationPost annKey1 indented
|
||||||
|
@ -1048,8 +1065,8 @@ transformSimplifyColumns = Uniplate.rewrite $ \case
|
||||||
-- ensureIndent float-in
|
-- ensureIndent float-in
|
||||||
-- not sure if the following rule is necessary; tests currently are
|
-- not sure if the following rule is necessary; tests currently are
|
||||||
-- unaffected.
|
-- unaffected.
|
||||||
BDEnsureIndent indent (BDLines lines) ->
|
-- BDEnsureIndent indent (BDLines lines) ->
|
||||||
Just $ BDLines $ BDEnsureIndent indent <$> lines
|
-- Just $ BDLines $ BDEnsureIndent indent <$> lines
|
||||||
-- matching col special transformation
|
-- matching col special transformation
|
||||||
BDCols sig1 cols1@(_:_)
|
BDCols sig1 cols1@(_:_)
|
||||||
| BDLines lines@(_:_:_) <- List.last cols1
|
| BDLines lines@(_:_:_) <- List.last cols1
|
||||||
|
|
Loading…
Reference in New Issue