on master help sign in
Merge pull request #545 from david-christiansen/issue/526
1aa559fEdwin Brady
src/Idris/REPL.hs+4−1
@@ -280,7 +280,7 @@ edit f orig
280 let line = case errLine i of
280 let line = case errLine i of
281 Just l -> " +" ++ show l ++ " "
281 Just l -> " +" ++ show l ++ " "
282 Nothing -> " "
282 Nothing -> " "
283− let cmd = editor ++ line ++ f
283+ let cmd = editor ++ line ++ fixName f
284 runIO $ system cmd
284 runIO $ system cmd
285 clearErr
285 clearErr
286 putIState $ orig { idris_options = idris_options i
286 putIState $ orig { idris_options = idris_options i
@@ -292,6 +292,9 @@ edit f orig
292 where getEditor env | Just ed <- lookup "EDITOR" env = ed
292 where getEditor env | Just ed <- lookup "EDITOR" env = ed
293 | Just ed <- lookup "VISUAL" env = ed
293 | Just ed <- lookup "VISUAL" env = ed
294 | otherwise = "vi"
294 | otherwise = "vi"
295+ fixName file | map toLower (takeExtension file) `elem` [".lidr", ".idr"] = file
296+ | otherwise = addExtension file "idr"
297+
295
298
296
299
297proofs :: IState -> Idris ()
300proofs :: IState -> Idris ()