Fix Alt-transformation bug with BDFEnsureIndents

multiple BDFEnsureIndent nodes were mistreated previously
pull/124/head
Lennart Spitzner 2018-03-11 22:07:12 +01:00
parent 41a60ce60f
commit af7f9017b8
1 changed files with 10 additions and 5 deletions

View File

@ -319,10 +319,15 @@ transformAlts briDoc =
BrIndentNone -> 0
BrIndentRegular -> indAmount
BrIndentSpecial i -> i
mSet $ acp { _acp_indentPrep = 0 -- TODO: i am not sure this is valid,
-- in general.
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
, _acp_line = max (_acp_line acp) (_acp_indent acp + indAdd)
-- we cannot use just _acp_line acp + indAdd because of the case
-- where there are multiple BDFEnsureIndents in the same line.
-- Then, the actual indentation is relative to the current
-- indentation, not the current cursor position.
}
r <- rec bd
acp' <- mGet