Add indentation to the paragraphs inserted in patterns
Ugly, but fixes #6. Ugly still better than non-valid-haskell result.pull/35/head
parent
8d163eb099
commit
cea81d5369
|
@ -702,6 +702,15 @@ showPackageDetailedInfo pkginfo =
|
||||||
isValidPosition position | validX && validY = Just position
|
isValidPosition position | validX && validY = Just position
|
||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
|
|
||||||
|
#test issue-6-pattern-linebreak-validity
|
||||||
|
## this is ugly, but at least syntactically valid.
|
||||||
|
foo = Reflex.runSpiderHost $ ReflexHost.hostApp $ do
|
||||||
|
(inputEvent :: Reflex.Event Reflex.Spider String, inputFire :: String
|
||||||
|
-> IO Bool ) <-
|
||||||
|
ReflexHost.newExternalEvent
|
||||||
|
liftIO . forkIO . forever $ getLine >>= inputFire
|
||||||
|
ReflexHost.performEvent_ $ fmap (liftIO . putStrLn) inputEvent
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -738,11 +747,3 @@ isValidPosition position | validX && validY = Just position
|
||||||
## where
|
## where
|
||||||
## role = stringProperty "WM_WINDOW_ROLE"
|
## role = stringProperty "WM_WINDOW_ROLE"
|
||||||
|
|
||||||
#test linebreak
|
|
||||||
#pending
|
|
||||||
|
|
||||||
foo = Reflex.runSpiderHost $ ReflexHost.hostApp $ do
|
|
||||||
(inputEvent :: Reflex.Event Reflex.Spider String, inputFire :: String -> IO Bool)
|
|
||||||
<- ReflexHost.newExternalEvent
|
|
||||||
liftIO . forkIO . forever $ getLine >>= inputFire
|
|
||||||
ReflexHost.performEvent_ $ fmap (liftIO . putStrLn) inputEvent
|
|
||||||
|
|
|
@ -109,10 +109,17 @@ layoutPat lpat@(L _ pat) = docWrapNode lpat $ case pat of
|
||||||
case Seq.viewr patDocs of
|
case Seq.viewr patDocs of
|
||||||
Seq.EmptyR -> error "cannot happen ljoiuxoasdcoviuasd"
|
Seq.EmptyR -> error "cannot happen ljoiuxoasdcoviuasd"
|
||||||
xR Seq.:> xN -> do
|
xR Seq.:> xN -> do
|
||||||
xN' <- docSeq
|
xN' <- -- at the moment, we don't support splitting patterns into
|
||||||
|
-- multiple lines. but we cannot enforce pasting everything
|
||||||
|
-- into one line either, because the type signature will ignore
|
||||||
|
-- this if we overflow sufficiently.
|
||||||
|
-- In order to prevent syntactically invalid results in such
|
||||||
|
-- cases, we need the AddBaseY here.
|
||||||
|
-- This can all change when patterns get multiline support.
|
||||||
|
docAddBaseY BrIndentRegular $ docSeq
|
||||||
[ appSep $ return xN
|
[ appSep $ return xN
|
||||||
, appSep $ docLit $ Text.pack "::"
|
, appSep $ docLit $ Text.pack "::"
|
||||||
, tyDoc
|
, docForceSingleline $ tyDoc
|
||||||
]
|
]
|
||||||
return $ xR Seq.|> xN'
|
return $ xR Seq.|> xN'
|
||||||
ListPat elems _ _ ->
|
ListPat elems _ _ ->
|
||||||
|
|
Loading…
Reference in New Issue