issue: vim recovery will not work unless orphaned vim swap
file extension begins with "sw"
scenario:
os crashes while gvim has a number of unnamed editing
sessions opened
after rebooting the os, i locate the orphaned vim swap file
the file is named _.svz (windoze crashes a lot)
when i attempt "vim -r _.svz" this message is returned:
"E305: No swap file found for _.svz"
i then change the filename to _.swz
and issue the "vim -r _.swz" command
and the file is recovered
can anyone confirm this same behavior? and whether this is a
bug or a feature?
thanks,
david
And obviously don't do like me, avoid top posting.
I can reproduce it on Linux too (Vim-7.2.267). File ".svz" can't be
recovered with "vim -r .svz". And Ex command ":recover .svz" gives
the following error:
"E305: No swap file found for .svz"
But file can successfully be recovered after renaming it:
$ mv .svz .swz
$ vim -r .swz
I suppose that it's a bug.
-- Dominique
The guidelines for the list may be found at:
http://groups.google.com/group/vim_use/web/vim-information
Chip Campbell
It used to be a feature, but I can understand it can be annoying.
Let's extend the range of files recognized as a swap file to:
.s[uvw][a-z]
*** ../vim-7.2.267/src/memline.c 2009-04-22 15:56:27.000000000 +0200
--- src/memline.c 2009-10-29 20:55:08.000000000 +0100
***************
*** 864,884 ****
recoverymode = TRUE;
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
attr = hl_attr(HLF_E);
! /*
! * If the file name ends in ".sw?" we use it directly.
! * Otherwise a search is done to find the swap file(s).
! */
fname = curbuf->b_fname;
if (fname == NULL) /* When there is no file name */
fname = (char_u *)"";
len = (int)STRLEN(fname);
if (len >= 4 &&
#if defined(VMS) || defined(RISCOS)
! STRNICMP(fname + len - 4, "_sw" , 3)
#else
! STRNICMP(fname + len - 4, ".sw" , 3)
#endif
! == 0)
{
directly = TRUE;
fname = vim_strsave(fname); /* make a copy for mf_open() */
--- 864,887 ----
recoverymode = TRUE;
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
attr = hl_attr(HLF_E);
!
! /*
! * If the file name ends in ".s[uvw][a-z]" we assume this is the swap file.
! * Otherwise a search is done to find the swap file(s).
! */
fname = curbuf->b_fname;
if (fname == NULL) /* When there is no file name */
fname = (char_u *)"";
len = (int)STRLEN(fname);
if (len >= 4 &&
#if defined(VMS) || defined(RISCOS)
! STRNICMP(fname + len - 4, "_s" , 2)
#else
! STRNICMP(fname + len - 4, ".s" , 2)
#endif
! == 0
! && vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL
! && ASCII_ISALPHA(fname[len - 1]))
{
directly = TRUE;
fname = vim_strsave(fname); /* make a copy for mf_open() */
--
TIM: To the north there lies a cave, the cave of Caerbannog, wherein, carved
in mystic runes, upon the very living rock, the last words of Olfin
Bedwere of Rheged make plain the last resting place of the most Holy
Grail.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///