Skip to content

Commit

Permalink
Do not repeat filename twice after :w command.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercrow committed Sep 3, 2012
1 parent bf5b459 commit dc70cc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yi/src/library/Yi/File.hs
Expand Up @@ -115,15 +115,19 @@ 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 ()
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 ()
Expand Down

0 comments on commit dc70cc0

Please sign in to comment.