Skip to content

Commit

Permalink
Added an error message to -s failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
SOwOphie committed Sep 18, 2016
1 parent 5a04b38 commit 6a680ef
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions WSEdit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,28 @@ start = do
$ drop 5
$ linesPlus r

conf' = unPrettyEdConfig
(vtyObj conf)
(keymap conf)
$ readNote (fqn "start:1")
conf' = fmap ( unPrettyEdConfig
(vtyObj conf)
(keymap conf)
)
$ readMay
$ unlinesPlus cLines

st = readNote (fqn "start:2")
st = readMay
$ unlinesPlus sLines

return (conf', st)
case (conf', st) of
(Just c, Just s) -> return (c, s)
_ -> do
shutdown v

putStrLn $ "-s: parse error. Are "
++ "you sure you aren't "
++ "trying to open a "
++ "different version's "
++ "dump?"

exitFailure

else return (conf, def { fname = fromMaybe "" filename
, loadPos = (tLnNo, tColNo)
Expand Down

0 comments on commit 6a680ef

Please sign in to comment.