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 / 6.0.081 < prev    next >
Encoding:
Internet Message Format  |  2001-11-04  |  2.4 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.081
  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 6.0.081
  11. Problem:    After using ":saveas" the new buffer name is added to the Buffers
  12.         menu with a wrong number. (Chauk-Mean Proum)
  13. Solution:   Trigger BufFilePre and BufFilePost events for the renamed buffer
  14.         and BufAdd for the old name (which is with a new buffer).
  15. Files:        src/ex_cmds.c
  16.  
  17.  
  18. *** ../vim60.80/src/ex_cmds.c    Mon Nov  5 21:04:40 2001
  19. --- src/ex_cmds.c    Mon Nov  5 21:16:41 2001
  20. ***************
  21. *** 2142,2147 ****
  22. --- 2142,2158 ----
  23.   
  24.       if (eap->cmdidx == CMD_saveas && alt_buf != NULL)
  25.       {
  26. + #ifdef FEAT_AUTOCMD
  27. +     buf_T    *was_curbuf = curbuf;
  28. +     apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
  29. +     if (curbuf != was_curbuf)
  30. +     {
  31. +         /* buffer changed, don't change name now */
  32. +         retval = FAIL;
  33. +         goto theend;
  34. +     }
  35. + #endif
  36.       /* Exchange the file names for the current and the alternate buffer.
  37.        * This makes it look like we are now editing the buffer under the new
  38.        * name.  Must be done before buf_write(), because if there is no file
  39. ***************
  40. *** 2157,2166 ****
  41.       curbuf->b_sfname = fname;
  42.       buf_name_changed();
  43.   #ifdef FEAT_AUTOCMD
  44.       if (!alt_buf->b_p_bl)
  45.       {
  46.           alt_buf->b_p_bl = TRUE;
  47. !         apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf);
  48.       }
  49.   #endif
  50.       }
  51. --- 2168,2184 ----
  52.       curbuf->b_sfname = fname;
  53.       buf_name_changed();
  54.   #ifdef FEAT_AUTOCMD
  55. +     apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
  56.       if (!alt_buf->b_p_bl)
  57.       {
  58.           alt_buf->b_p_bl = TRUE;
  59. !         apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, alt_buf);
  60. !     }
  61. !     if (curbuf != was_curbuf)
  62. !     {
  63. !         /* buffer changed, don't write the file */
  64. !         retval = FAIL;
  65. !         goto theend;
  66.       }
  67.   #endif
  68.       }
  69. *** ../vim60.80/src/version.c    Mon Nov  5 21:04:40 2001
  70. --- src/version.c    Mon Nov  5 21:23:51 2001
  71. ***************
  72. *** 608,609 ****
  73. --- 608,611 ----
  74.   {   /* Add new patch number below this line */
  75. + /**/
  76. +     81,
  77.   /**/
  78.  
  79. -- 
  80. hundred-and-one symptoms of being an internet addict:
  81. 5. You find yourself brainstorming for new subjects to search.
  82.  
  83.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  84. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  85.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  86.