Only expand empty binding list with comments

pull/83/head
sniperrifle2004 2017-12-22 10:08:30 +01:00
parent 3708838b6a
commit ad34a8b9b9
3 changed files with 11 additions and 2 deletions

View File

@ -786,6 +786,9 @@ import Test ( Thing( With
-- !
)
)
#test prefer-dense-empty-list
import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine
( )
#test preamble full-preamble
{-# LANGUAGE BangPatterns #-}

View File

@ -793,6 +793,9 @@ import Test ( Thing( With
)
)
#test prefer-dense-empty-list
import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine ()
#test preamble full-preamble
{-# LANGUAGE BangPatterns #-}

View File

@ -118,8 +118,11 @@ layoutLLIEs llies = do
case ieDs of
[] -> docAltFilter
[ (not hasComments, docLit $ Text.pack "()")
, (otherwise, docPar (docSeq [docParenLSep, docWrapNode llies docEmpty])
docParenR)
, ( hasComments
, docPar
(docSeq [docParenLSep, docWrapNodeRest llies docEmpty])
docParenR
)
]
(ieDsH:ieDsT) ->
docAltFilter