To: vim-dev@vim.org Subject: Patch 5.6.091 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.091 Problem: When editing many "no file" files, can't create swap file, because .sw[a-p] have all been used. (Neil Bird) Solution: Also use ".sv[a-z]", ".su[a-z]", etc. Files: src/memline.c *** ../vim-5.6.90/src/memline.c Sat Apr 22 22:55:10 2000 --- src/memline.c Tue Jun 6 14:08:36 2000 *************** *** 3380,3386 **** * file names. If this is the first try and the swap file name does not fit in * 8.3, detect if this is the case, set shortname and try again. */ ! if (fname[n - 1] == 'p' && !(buf->b_p_sn || buf->b_shortname)) { char_u *tail; char_u *fname2; --- 3380,3387 ---- * file names. If this is the first try and the swap file name does not fit in * 8.3, detect if this is the case, set shortname and try again. */ ! if (fname[n - 2] == 'w' && fname[n - 1] == 'p' ! && !(buf->b_p_sn || buf->b_shortname)) { char_u *tail; char_u *fname2; *************** *** 3525,3531 **** /* * get here when file already exists */ ! if (fname[n - 1] == 'p') /* first try */ { #ifndef SHORT_FNAME /* --- 3526,3532 ---- /* * get here when file already exists */ ! if (fname[n - 2] == 'w' && fname[n - 1] == 'p') /* first try */ { #ifndef SHORT_FNAME /* *************** *** 3688,3700 **** } } ! if (fname[n - 1] == 'a') /* tried enough names, give up */ { ! vim_free(fname); ! fname = NULL; ! break; } ! --fname[n - 1]; /* change last char of the name */ } vim_free(dir_name); --- 3689,3712 ---- } } ! /* ! * Change the ".swp" extension to find another file that can be used. ! * First decrement the last char: ".swo", ".swn", etc. ! * If that still isn't enough decrement the last but one char: ".svz" ! * Can happen when editing many "No File" buffers. ! */ ! if (fname[n - 1] == 'a') /* ".s?a" */ { ! if (fname[n - 2] == 'a') /* ".saa": tried enough, give up */ ! { ! vim_free(fname); ! fname = NULL; ! break; ! } ! --fname[n - 2]; /* ".svz", ".suz", etc. */ ! fname[n - 1] = 'z' + 1; } ! --fname[n - 1]; /* ".swo", ".swn", etc. */ } vim_free(dir_name); *** ../vim-5.6.90/src/version.c Mon Jun 5 20:51:27 2000 --- src/version.c Tue Jun 6 14:10:07 2000 *************** *** 420,421 **** --- 420,423 ---- { /* Add new patch number below this line */ + /**/ + 91, /**/ -- ARTHUR: You are indeed brave Sir knight, but the fight is mine. BLACK KNIGHT: Had enough? ARTHUR: You stupid bastard. You havn't got any arms left. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\ \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/