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.219 < prev    next >
Encoding:
Internet Message Format  |  2007-03-17  |  4.0 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 7.0.219
  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.219
  11. Problem:    When using the 'editexisting.vim' script and a file is being
  12.         edited in another tab page the window is split.  The "+123"
  13.         argument is not used.
  14. Solution:   Make the tab page with the file the current tab page.  Set
  15.         v:swapcommand when starting up to the first "+123" or "-c" command
  16.         line argument.
  17. Files:        runtime/macros/editexisting.vim, src/main.c
  18.  
  19.  
  20. *** ../vim-7.0.218/runtime/macros/editexisting.vim    Sun Apr 30 20:33:40 2006
  21. --- runtime/macros/editexisting.vim    Sat Mar 17 22:21:30 2007
  22. ***************
  23. *** 1,6 ****
  24.   " Vim Plugin:    Edit the file with an existing Vim if possible
  25.   " Maintainer:    Bram Moolenaar
  26. ! " Last Change:    2006 Apr 30
  27.   
  28.   " This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
  29.   " $VIM/vimfiles/plugin directory.  Or make a symbolic link, so that you
  30. --- 1,6 ----
  31.   " Vim Plugin:    Edit the file with an existing Vim if possible
  32.   " Maintainer:    Bram Moolenaar
  33. ! " Last Change:    2007 Mar 17
  34.   
  35.   " This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
  36.   " $VIM/vimfiles/plugin directory.  Or make a symbolic link, so that you
  37. ***************
  38. *** 85,93 ****
  39.   " Function used on the server to make the file visible and possibly execute a
  40.   " command.
  41.   func! EditExisting(fname, command)
  42. !   let n = bufwinnr(a:fname)
  43. !   if n > 0
  44. !     exe n . "wincmd w"
  45.     else
  46.       exe "split " . escape(a:fname, ' #%"|')
  47.     endif
  48. --- 85,107 ----
  49.   " Function used on the server to make the file visible and possibly execute a
  50.   " command.
  51.   func! EditExisting(fname, command)
  52. !   " Get the window number of the file in the current tab page.
  53. !   let winnr = bufwinnr(a:fname)
  54. !   if winnr <= 0
  55. !     " Not found, look in other tab pages.
  56. !     let bufnr = bufnr(a:fname)
  57. !     for i in range(tabpagenr('$'))
  58. !       if index(tabpagebuflist(i + 1), bufnr) >= 0
  59. !     " Make this tab page the current one and find the window number.
  60. !     exe 'tabnext ' . (i + 1)
  61. !     let winnr = bufwinnr(a:fname)
  62. !     break;
  63. !       endif
  64. !     endfor
  65. !   endif
  66. !   if winnr > 0
  67. !     exe winnr . "wincmd w"
  68.     else
  69.       exe "split " . escape(a:fname, ' #%"|')
  70.     endif
  71. *** ../vim-7.0.218/src/main.c    Tue Feb 27 16:51:07 2007
  72. --- src/main.c    Sun Mar 18 21:51:48 2007
  73. ***************
  74. *** 798,803 ****
  75. --- 798,808 ----
  76.       create_windows(¶ms);
  77.       TIME_MSG("opening buffers");
  78.   
  79. + #ifdef FEAT_EVAL
  80. +     /* clear v:swapcommand */
  81. +     set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
  82. + #endif
  83.       /* Ex starts at last line of the file */
  84.       if (exmode_active)
  85.       curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
  86. ***************
  87. *** 2202,2207 ****
  88. --- 2207,2227 ----
  89.           argv_idx = 1;
  90.       }
  91.       }
  92. + #ifdef FEAT_EVAL
  93. +     /* If there is a "+123" or "-c" command, set v:swapcommand to the first
  94. +      * one. */
  95. +     if (parmp->n_commands > 0)
  96. +     {
  97. +     p = alloc((unsigned)STRLEN(parmp->commands[0]) + 3);
  98. +     if (p != NULL)
  99. +     {
  100. +         sprintf((char *)p, ":%s\r", parmp->commands[0]);
  101. +         set_vim_var_string(VV_SWAPCOMMAND, p, -1);
  102. +         vim_free(p);
  103. +     }
  104. +     }
  105. + #endif
  106.   }
  107.   
  108.   /*
  109. *** ../vim-7.0.218/src/version.c    Thu Mar 15 22:54:51 2007
  110. --- src/version.c    Sun Mar 18 21:49:11 2007
  111. ***************
  112. *** 668,669 ****
  113. --- 668,671 ----
  114.   {   /* Add new patch number below this line */
  115. + /**/
  116. +     219,
  117.   /**/
  118.  
  119. -- 
  120. FATHER:    You only killed the bride's father - that's all -
  121. LAUNCELOT: Oh dear, I didn't really mean to...
  122. FATHER:    Didn't mean to?  You put your sword right through his head!
  123. LAUNCELOT: Gosh - Is he all right?
  124.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  125.  
  126.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  127. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  128. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  129.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  130.