Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Do not repeat filename twice after :w command.

  • Loading branch information...
commit dc70cc0cf05d9a66dd9d94e5577857f2b10802d7 1 parent bf5b459
@ethercrow ethercrow authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 yi/src/library/Yi/File.hs
View
8 yi/src/library/Yi/File.hs
@@ -115,7 +115,9 @@ viWrite = do
bufInfo <- withBuffer bufInfoB
let s = bufInfoFileName bufInfo
fwriteE
- msgEditor $ show f ++ " " ++ show s ++ " written"
+ let message = if f == s then show f ++ " written"
+ else show f ++ " " ++ show s ++ " written"
+ msgEditor message
-- | Try to write to a named file in the manner of vi\/vim
viWriteTo :: String -> YiM ()
@@ -123,7 +125,9 @@ viWriteTo f = do
bufInfo <- withBuffer bufInfoB
let s = bufInfoFileName bufInfo
fwriteToE f
- msgEditor $ show f++" "++show s ++ " written"
+ let message = if f == s then show f ++ " written"
+ else show f ++ " " ++ show s ++ " written"
+ msgEditor message
-- | Try to write to a named file if it doesn't exist. Error out if it does.
viSafeWriteTo :: String -> YiM ()
Please sign in to comment.
Something went wrong with that request. Please try again.