Fix bug in record layouting causing overflows

pull/288/head
Lennart Spitzner 2020-02-25 17:55:20 +01:00
parent a3b501051a
commit 4b673d1d9d
2 changed files with 18 additions and 9 deletions

View File

@ -363,14 +363,13 @@ samples = (SV.unpackaaaaadat) <&> \f ->
#test recordupd-singleline-bug
runBrittany tabSize text = do
let
config' = staticDefaultConfig
config = config'
{ _conf_layout = (_conf_layout config') { _lconfig_indentAmount = coerce
tabSize
}
, _conf_forward = forwardOptionsSyntaxExtsEnabled
}
let config' = staticDefaultConfig
config = config'
{ _conf_layout = (_conf_layout config')
{ _lconfig_indentAmount = coerce tabSize
}
, _conf_forward = forwardOptionsSyntaxExtsEnabled
}
parsePrintModule config text
#test recordupd-singleline-bug-left
@ -860,3 +859,13 @@ xeoeqibIaib
]
m
()
#test recordupd-overflow-bad-multiline-spacing
createRedirectedProcess processConfig = do
let redirectedProc = (_processConfig_inner processConfig)
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
foo

View File

@ -1226,7 +1226,7 @@ recordExpression dotdot indentPolicy lexpr nameDoc rFs@(rF1:rFr) = do
-- }
addAlternativeCond (indentPolicy == IndentPolicyFree)
$ docSeq
[ docNodeAnnKW lexpr Nothing $ appSep nameDoc
[ docNodeAnnKW lexpr Nothing $ docForceSingleline $ appSep nameDoc
, docSetBaseY $ docLines $ let
line1 = docCols ColRec
[ appSep $ docLit $ Text.pack "{"