Permalink
Browse files

recovering not working when creating new files (issue #11)

  • Loading branch information...
1 parent 6ab610b commit be6bbecb8d600d95bd51362ec994304b8152a84c @chrisbra committed Sep 22, 2012
Showing with 18 additions and 11 deletions.
  1. +9 −7 autoload/recover.vim
  2. +6 −1 doc/recoverPlugin.txt
  3. +3 −3 plugin/recover.vim
View
@@ -1,11 +1,11 @@
" Vim plugin for diffing when swap file was found
" ---------------------------------------------------------------
" Author: Christian Brabandt <cb@256bit.org>
-" Version: 0.14
-" Last Change: Sat, 31 Mar 2012 13:29:07 +0200
+" Version: 0.15
+" Last Change: Mon, 20 Aug 2012 20:16:32 +0200
" Script: http://www.vim.org/scripts/script.php?script_id=3068
" License: VIM License
-" GetLatestVimScripts: 3068 14 :AutoInstall: recover.vim
+" GetLatestVimScripts: 3068 15 :AutoInstall: recover.vim
"
fu! recover#Recover(on) "{{{1
if a:on
@@ -151,8 +151,10 @@ fu! recover#DiffRecoveredFile() "{{{1
set nospr
noa vert new
let &l:spr = curspr
- 0r #
- $d _
+ if glob(expand('#'))
+ 0r #
+ $d _
+ endif
if l:filetype != ""
exe "setl filetype=".l:filetype
endif
@@ -252,12 +254,12 @@ fu! recover#AutoCmdBRP(on) "{{{1
" backslashes might exists in the path, so we handle this
" situation there differently.
if has("win16") || has("win32") || has("win64") || has("win32unix")
- exe ":au BufReadPost "
+ exe ":au BufNewFile,BufReadPost "
\ escape(substitute(fnamemodify(expand('<afile>'),
\ ':p'), '\\', '/', 'g'), ' \\')"
\ :call s:CheckRecover()"
else
- exe ":au BufReadPost " escape(fnamemodify(expand('<afile>'),
+ exe ":au BufNewFile,BufReadPost " escape(fnamemodify(expand('<afile>'),
\ ':p'), ' \\')" :call s:CheckRecover()"
endif
augroup END
@@ -1,7 +1,7 @@
*recover.vim* Show differences for recovered files
Author: Christian Brabandt <cb@256bit.org>
-Version: 0.14 Sat, 31 Mar 2012 13:29:07 +0200
+Version: 0.15 Mon, 20 Aug 2012 20:16:32 +0200
Copyright: (c) 2009, 2010 by Christian Brabandt
The VIM LICENSE applies to recoverPlugin.vim and recoverPlugin.txt
(see |copyright|) except use recoverPlugin instead of "Vim".
@@ -101,6 +101,11 @@ third line of this document.
==============================================================================
4. recover History *recover-history*
+0.16: (unreleased) "{{{1
+- Recovery did not work, when original file did not exists (issue 11
+ https://github.com/chrisbra/Recover.vim/issues/11
+ reported by Rking, thanks!)
+
0.15: Aug 20, 2012 "{{{1
- fix issue 5 (https://github.com/chrisbra/Recover.vim/issues/5 patch by
View
@@ -1,10 +1,10 @@
" Vim plugin for diffing when swap file was found
-" Last Change: Sat, 31 Mar 2012 13:29:07 +0200
-" Version: 0.14
+" Last Change: Mon, 20 Aug 2012 20:16:32 +0200
+" Version: 0.15
" Author: Christian Brabandt <cb@256bit.org>
" Script: http://www.vim.org/scripts/script.php?script_id=3068
" License: VIM License
-" GetLatestVimScripts: 3068 13 :AutoInstall: recover.vim
+" GetLatestVimScripts: 3068 14 :AutoInstall: recover.vim
" Documentation: see :h recoverPlugin.txt
" ---------------------------------------------------------------------

0 comments on commit be6bbec

Please sign in to comment.