Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

1 participant

@ethercrow
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.

@ethercrow ethercrow merged commit 9965d30 into yi-editor:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 3, 2012
  1. @ethercrow
This page is out of date. Refresh to see the latest.
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 ()
Something went wrong with that request. Please try again.