@@ -79,7 +79,7 @@ read console state = do
79
79
80
80
print :: ConsoleReader -> Command -> ReplResult -> ReplEnv -> IO ()
81
81
print _ Java (JavaSource src) _ = javaSourceGUI src
82
- print _ (HelpDoc src) (DocHelp doc) _ = helpGUI src doc
82
+ print _ (HelpDoc src) (DocHelp doc) _ = if null doc then return () else helpGUI src doc
83
83
print console _ (ReplInfo msgs) _ = printMessages console msgs
84
84
print console (cmd@ (Eval line)) (CodeInfo sourceRepr g msgs) env = case sourceRepr of
85
85
Expression sym | isVariable g sym =
@@ -295,7 +295,11 @@ helpGUI title content = do
295
295
frame. setDefaultCloseOperation JFrame. dispose_on_close
296
296
newContentPane:: JPanel <- BorderLayout. new () >>= JPanel. new
297
297
let html :: String
298
- html = substring content $ indexOf content " <HTML>" -- Skip DOCTYPE
298
+ html
299
+ | index >= 0 = substring content index -- Skip DOCTYPE
300
+ | otherwise = content
301
+ where
302
+ index = indexOf content " <HTML>"
299
303
editor:: JEditorPane <- JEditorPane. new " text/html" html
300
304
editor. setEditable false
301
305
helpLinksListener <- FregeJavaProxy. with showDesktop HyperlinkListener. clazz
@@ -328,7 +332,7 @@ derive ArrayElement Object
328
332
type ObjectArray = JArray Object
329
333
330
334
fixHelpLink s | Just (Just relative : _)
331
- <- s `match` #^\.\. (.*) $# = " http://try .frege-lang.org/doc/frege" ++ relative
335
+ <- s `match` #^\.\. (.*) $# = " http://www .frege-lang.org/doc/frege" ++ relative
332
336
fixHelpLink s = s
333
337
334
338
native toURI :: URL -> ST s URI throws URISyntaxException
0 commit comments