Skip to content
This repository

Do not repeat filename twice after :w command. #39

Merged
merged 1 commit into from over 1 year ago

1 participant

Dmitry Ivanov
Dmitry Ivanov
Owner

This fixes http://code.google.com/p/yi-editor/issues/detail?id=373

If file name and buffer name differ, message in statusbar will show both.

Dmitry Ivanov ethercrow merged commit 9965d30 into from September 16, 2012
Dmitry Ivanov ethercrow closed this September 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 03, 2012
Dmitry Ivanov Do not repeat filename twice after :w command. dc70cc0
This page is out of date. Refresh to see the latest.

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 ()
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.