]> granicus.if.org Git - vim/commitdiff
updated for version 7.0-162 v7.0.162
authorBram Moolenaar <Bram@vim.org>
Tue, 7 Nov 2006 21:59:47 +0000 (21:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 7 Nov 2006 21:59:47 +0000 (21:59 +0000)
src/buffer.c
src/main.c
src/version.c

index c9a91ceb3546ba00e8c7b3dfe120707ff9581ba1..4049f711b67f0b682c0ba6abd18c0eb3a9186a0a 100644 (file)
@@ -4220,7 +4220,7 @@ alist_name(aep)
 
     /* Use the name from the associated buffer if it exists. */
     bp = buflist_findnr(aep->ae_fnum);
-    if (bp == NULL)
+    if (bp == NULL || bp->b_fname == NULL)
        return aep->ae_fname;
     return bp->b_fname;
 }
index f903d06e2abdd4df84b2545bf8ea13bb5f20c07e..4791c68bf57d72fee72a401311be7dc82a490cb8 100644 (file)
@@ -2392,7 +2392,23 @@ create_windows(parmp)
                (void)open_buffer(FALSE, NULL); /* create memfile, read file */
 
 #if defined(HAS_SWAP_EXISTS_ACTION)
-               check_swap_exists_action();
+               if (swap_exists_action == SEA_QUIT)
+               {
+                   if (got_int || only_one_window())
+                   {
+                       /* abort selected or quit and only one window */
+                       did_emsg = FALSE;   /* avoid hit-enter prompt */
+                       getout(1);
+                   }
+                   /* We can't close the window, it would disturb what
+                    * happens next.  Clear the file name and set the arg
+                    * index to -1 to delete it later. */
+                   setfname(curbuf, NULL, NULL, FALSE);
+                   curwin->w_arg_idx = -1;
+                   swap_exists_action = SEA_NONE;
+               }
+               else
+                   handle_swap_exists(NULL);
 #endif
 #ifdef FEAT_AUTOCMD
                dorewind = TRUE;                /* start again */
@@ -2432,6 +2448,8 @@ edit_buffers(parmp)
 {
     int                arg_idx;                /* index in argument list */
     int                i;
+    int                advance = TRUE;
+    buf_T      *old_curbuf;
 
 # ifdef FEAT_AUTOCMD
     /*
@@ -2440,31 +2458,65 @@ edit_buffers(parmp)
     ++autocmd_no_enter;
     ++autocmd_no_leave;
 # endif
+
+    /* When w_arg_idx is -1 remove the window (see create_windows()). */
+    if (curwin->w_arg_idx == -1)
+    {
+       win_close(curwin, TRUE);
+       advance = FALSE;
+    }
+
     arg_idx = 1;
     for (i = 1; i < parmp->window_count; ++i)
     {
-       if (parmp->window_layout == WIN_TABS)
+       /* When w_arg_idx is -1 remove the window (see create_windows()). */
+       if (curwin->w_arg_idx == -1)
        {
-           if (curtab->tp_next == NULL)        /* just checking */
-               break;
-           goto_tabpage(0);
+           ++arg_idx;
+           win_close(curwin, TRUE);
+           advance = FALSE;
+           continue;
        }
-       else
+
+       if (advance)
        {
-           if (curwin->w_next == NULL)         /* just checking */
-               break;
-           win_enter(curwin->w_next, FALSE);
+           if (parmp->window_layout == WIN_TABS)
+           {
+               if (curtab->tp_next == NULL)    /* just checking */
+                   break;
+               goto_tabpage(0);
+           }
+           else
+           {
+               if (curwin->w_next == NULL)     /* just checking */
+                   break;
+               win_enter(curwin->w_next, FALSE);
+           }
        }
+       advance = TRUE;
 
        /* Only open the file if there is no file in this window yet (that can
-        * happen when .vimrc contains ":sall") */
+        * happen when .vimrc contains ":sall"). */
        if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
        {
            curwin->w_arg_idx = arg_idx;
-           /* edit file from arg list, if there is one */
+           /* Edit file from arg list, if there is one.  When "Quit" selected
+            * at the ATTENTION prompt close the window. */
+           old_curbuf = curbuf;
            (void)do_ecmd(0, arg_idx < GARGCOUNT
                          ? alist_name(&GARGLIST[arg_idx]) : NULL,
                          NULL, NULL, ECMD_LASTL, ECMD_HIDE);
+           if (curbuf == old_curbuf)
+           {
+               if (got_int || only_one_window())
+               {
+                   /* abort selected or quit and only one window */
+                   did_emsg = FALSE;   /* avoid hit-enter prompt */
+                   getout(1);
+               }
+               win_close(curwin, TRUE);
+               advance = FALSE;
+           }
            if (arg_idx == GARGCOUNT - 1)
                arg_had_last = TRUE;
            ++arg_idx;
index dabe3a78100fd55ab742f1e8cc37da33d570d90e..c1b30455cb947a14433d532bd4bc153324b08759 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    162,
 /**/
     161,
 /**/