Permalink
Browse files

only create undofiles for non-empty files

  • Loading branch information...
1 parent f2b976f commit 15d93a9c26c3a7952849042c53e58a5f5f1c328a @chrisbra committed Dec 6, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 autoload/SudoEdit.vim
View
@@ -61,7 +61,8 @@ fu! SudoEdit#LocalSettings(setflag) "{{{2
" to avoid stupid W13 warning
sil e! %
" Make sure, persistent undo information is written
- if has("persistent_undo")
+ " but only for valid files and not empty ones
+ if has("persistent_undo") && !empty(@%)
try
exe "wundo" fnameescape(undofile(@%))
if has("unix") || has("macunix")

0 comments on commit 15d93a9

Please sign in to comment.