on master help sign in
Take .lidr syntax into account with :addmissing

Fixes #1460.

commit86b60b2559e8ec973a82e69831f8a123c496ba35 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateTue 5 Aug 2014, 10:42 (12 years ago) parentd947282
1 file changed+5−1
src/Idris/Interactive.hs+5−1
src/Idris/Interactive.hs+5−1
@@ -28,6 +28,7 @@ import System.Directory
2828import System.IO
2929import Data.Char
3030import Data.Maybe (fromMaybe)
31+import Data.List (isSuffixOf)
3132
3233import Debug.Trace
3334
@@ -122,10 +123,13 @@ addMissing fn updatefile l n
122123 getAppName (PRef _ r) = r
123124 getAppName _ = n
124125
126+ makeIndent ind | ".lidr" `isSuffixOf` fn = '>' : ' ' : replicate (ind-2) ' '
127+ | otherwise = replicate ind ' '
128+
125129 showNew nm i ind (tm : tms)
126130 = do (nm', i') <- getUniq nm i
127131 rest <- showNew nm i' ind tms
128− return (replicate ind ' ' ++
132+ return (makeIndent ind ++
129133 showPat tm ++ " = ?" ++ nm' ++
130134 "\n" ++ rest)
131135 showNew nm i _ [] = return ""