Skip to content
This repository
Browse code

Do not repeat filename twice after :w command.

  • Loading branch information...
commit dc70cc0cf05d9a66dd9d94e5577857f2b10802d7 1 parent bf5b459
Dmitry Ivanov authored September 03, 2012

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  yi/src/library/Yi/File.hs
8  yi/src/library/Yi/File.hs
@@ -115,7 +115,9 @@ viWrite = do
115 115
             bufInfo <- withBuffer bufInfoB
116 116
             let s   = bufInfoFileName bufInfo
117 117
             fwriteE
118  
-            msgEditor $ show f ++ " " ++ show s ++ " written"
  118
+            let message = if f == s then show f ++ " written"
  119
+                                    else show f ++ " " ++ show s ++ " written"
  120
+            msgEditor message
119 121
 
120 122
 -- | Try to write to a named file in the manner of vi\/vim
121 123
 viWriteTo :: String -> YiM ()
@@ -123,7 +125,9 @@ viWriteTo f = do
123 125
     bufInfo <- withBuffer bufInfoB
124 126
     let s   = bufInfoFileName bufInfo
125 127
     fwriteToE f
126  
-    msgEditor $ show f++" "++show s ++ " written"
  128
+    let message = if f == s then show f ++ " written"
  129
+                            else show f ++ " " ++ show s ++ " written"
  130
+    msgEditor message
127 131
 
128 132
 -- | Try to write to a named file if it doesn't exist. Error out if it does.
129 133
 viSafeWriteTo :: String -> YiM ()

0 notes on commit dc70cc0

Please sign in to comment.
Something went wrong with that request. Please try again.