home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.0 / 7.0.162 < prev    next >
Encoding:
Internet Message Format  |  2006-11-06  |  5.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.0.162
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.0.162
  11. Problem:    "vim -o a b" when file "a" triggers the ATTENTION dialog,
  12.         selecting "Quit" exits Vim instead of editing "b" only.
  13.         When file "b" triggers the ATTENTION dialog selecting "Quit" or
  14.         "Abort" results in editing file "a" in that window.
  15. Solution:   When selecting "Abort" exit Vim.  When selecting "Quit" close the
  16.         window.  Also avoid hit-enter prompt when selecting Abort.
  17. Files:        src/buffer.c, src/main.c
  18.  
  19.  
  20. *** ../vim-7.0.161/src/buffer.c    Fri Oct 20 20:15:05 2006
  21. --- src/buffer.c    Tue Nov  7 21:08:02 2006
  22. ***************
  23. *** 4220,4226 ****
  24.   
  25.       /* Use the name from the associated buffer if it exists. */
  26.       bp = buflist_findnr(aep->ae_fnum);
  27. !     if (bp == NULL)
  28.       return aep->ae_fname;
  29.       return bp->b_fname;
  30.   }
  31. --- 4222,4228 ----
  32.   
  33.       /* Use the name from the associated buffer if it exists. */
  34.       bp = buflist_findnr(aep->ae_fnum);
  35. !     if (bp == NULL || bp->b_fname == NULL)
  36.       return aep->ae_fname;
  37.       return bp->b_fname;
  38.   }
  39. *** ../vim-7.0.161/src/main.c    Tue Sep  5 12:57:14 2006
  40. --- src/main.c    Tue Nov  7 22:35:49 2006
  41. ***************
  42. *** 2392,2398 ****
  43.           (void)open_buffer(FALSE, NULL); /* create memfile, read file */
  44.   
  45.   #if defined(HAS_SWAP_EXISTS_ACTION)
  46. !         check_swap_exists_action();
  47.   #endif
  48.   #ifdef FEAT_AUTOCMD
  49.           dorewind = TRUE;        /* start again */
  50. --- 2392,2414 ----
  51.           (void)open_buffer(FALSE, NULL); /* create memfile, read file */
  52.   
  53.   #if defined(HAS_SWAP_EXISTS_ACTION)
  54. !         if (swap_exists_action == SEA_QUIT)
  55. !         {
  56. !             if (got_int || only_one_window())
  57. !             {
  58. !             /* abort selected or quit and only one window */
  59. !             did_emsg = FALSE;   /* avoid hit-enter prompt */
  60. !             getout(1);
  61. !             }
  62. !             /* We can't close the window, it would disturb what
  63. !              * happens next.  Clear the file name and set the arg
  64. !              * index to -1 to delete it later. */
  65. !             setfname(curbuf, NULL, NULL, FALSE);
  66. !             curwin->w_arg_idx = -1;
  67. !             swap_exists_action = SEA_NONE;
  68. !         }
  69. !         else
  70. !             handle_swap_exists(NULL);
  71.   #endif
  72.   #ifdef FEAT_AUTOCMD
  73.           dorewind = TRUE;        /* start again */
  74. ***************
  75. *** 2432,2437 ****
  76. --- 2448,2455 ----
  77.   {
  78.       int        arg_idx;        /* index in argument list */
  79.       int        i;
  80. +     int        advance = TRUE;
  81. +     buf_T    *old_curbuf;
  82.   
  83.   # ifdef FEAT_AUTOCMD
  84.       /*
  85. ***************
  86. *** 2440,2470 ****
  87.       ++autocmd_no_enter;
  88.       ++autocmd_no_leave;
  89.   # endif
  90.       arg_idx = 1;
  91.       for (i = 1; i < parmp->window_count; ++i)
  92.       {
  93. !     if (parmp->window_layout == WIN_TABS)
  94.       {
  95. !         if (curtab->tp_next == NULL)    /* just checking */
  96. !         break;
  97. !         goto_tabpage(0);
  98.       }
  99. !     else
  100.       {
  101. !         if (curwin->w_next == NULL)        /* just checking */
  102. !         break;
  103. !         win_enter(curwin->w_next, FALSE);
  104.       }
  105.   
  106.       /* Only open the file if there is no file in this window yet (that can
  107. !      * happen when .vimrc contains ":sall") */
  108.       if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
  109.       {
  110.           curwin->w_arg_idx = arg_idx;
  111. !         /* edit file from arg list, if there is one */
  112.           (void)do_ecmd(0, arg_idx < GARGCOUNT
  113.                 ? alist_name(&GARGLIST[arg_idx]) : NULL,
  114.                 NULL, NULL, ECMD_LASTL, ECMD_HIDE);
  115.           if (arg_idx == GARGCOUNT - 1)
  116.           arg_had_last = TRUE;
  117.           ++arg_idx;
  118. --- 2458,2522 ----
  119.       ++autocmd_no_enter;
  120.       ++autocmd_no_leave;
  121.   # endif
  122. +     /* When w_arg_idx is -1 remove the window (see create_windows()). */
  123. +     if (curwin->w_arg_idx == -1)
  124. +     {
  125. +     win_close(curwin, TRUE);
  126. +     advance = FALSE;
  127. +     }
  128.       arg_idx = 1;
  129.       for (i = 1; i < parmp->window_count; ++i)
  130.       {
  131. !     /* When w_arg_idx is -1 remove the window (see create_windows()). */
  132. !     if (curwin->w_arg_idx == -1)
  133.       {
  134. !         ++arg_idx;
  135. !         win_close(curwin, TRUE);
  136. !         advance = FALSE;
  137. !         continue;
  138.       }
  139. !     if (advance)
  140.       {
  141. !         if (parmp->window_layout == WIN_TABS)
  142. !         {
  143. !         if (curtab->tp_next == NULL)    /* just checking */
  144. !             break;
  145. !         goto_tabpage(0);
  146. !         }
  147. !         else
  148. !         {
  149. !         if (curwin->w_next == NULL)    /* just checking */
  150. !             break;
  151. !         win_enter(curwin->w_next, FALSE);
  152. !         }
  153.       }
  154. +     advance = TRUE;
  155.   
  156.       /* Only open the file if there is no file in this window yet (that can
  157. !      * happen when .vimrc contains ":sall"). */
  158.       if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
  159.       {
  160.           curwin->w_arg_idx = arg_idx;
  161. !         /* Edit file from arg list, if there is one.  When "Quit" selected
  162. !          * at the ATTENTION prompt close the window. */
  163. !         old_curbuf = curbuf;
  164.           (void)do_ecmd(0, arg_idx < GARGCOUNT
  165.                 ? alist_name(&GARGLIST[arg_idx]) : NULL,
  166.                 NULL, NULL, ECMD_LASTL, ECMD_HIDE);
  167. +         if (curbuf == old_curbuf)
  168. +         {
  169. +         if (got_int || only_one_window())
  170. +         {
  171. +             /* abort selected or quit and only one window */
  172. +             did_emsg = FALSE;   /* avoid hit-enter prompt */
  173. +             getout(1);
  174. +         }
  175. +         win_close(curwin, TRUE);
  176. +         advance = FALSE;
  177. +         }
  178.           if (arg_idx == GARGCOUNT - 1)
  179.           arg_had_last = TRUE;
  180.           ++arg_idx;
  181. *** ../vim-7.0.161/src/version.c    Tue Nov  7 19:05:36 2006
  182. --- src/version.c    Tue Nov  7 21:21:28 2006
  183. ***************
  184. *** 668,669 ****
  185. --- 668,671 ----
  186.   {   /* Add new patch number below this line */
  187. + /**/
  188. +     162,
  189.   /**/
  190.  
  191. -- 
  192. The CIA drives around in cars with the "Intel inside" logo.
  193.  
  194.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  195. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  196. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  197.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  198.