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.3 / 7.3.591 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  5.1 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.591
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.591
  11. Problem:    Can only move to a tab by absolute number.
  12. Solution:   Move a number of tabs to the left or the right. (Lech Lorens)
  13. Files:        runtime/doc/tabpage.txt, src/ex_cmds.h, src/ex_docmd.c,
  14.         src/testdir/test62.in, src/testdir/test62.ok, src/window.c
  15.  
  16.  
  17. *** ../vim-7.3.590/runtime/doc/tabpage.txt    2010-08-15 21:57:17.000000000 +0200
  18. --- runtime/doc/tabpage.txt    2012-07-06 18:10:06.000000000 +0200
  19. ***************
  20. *** 173,182 ****
  21. --- 173,192 ----
  22.   REORDERING TAB PAGES:
  23.   
  24.   :tabm[ove] [N]                        *:tabm* *:tabmove*
  25. + :[N]tabm[ove]
  26.           Move the current tab page to after tab page N.  Use zero to
  27.           make the current tab page the first one.  Without N the tab
  28.           page is made the last one.
  29.   
  30. + :tabm[ove] +[N]
  31. + :tabm[ove] -[N]
  32. +         Move the current tab page N places to the right (with +) or to
  33. +         the left (with -).
  34. + Note that although it is possible to move a tab behind the N-th one by using
  35. + :Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For
  36. + clarification what +N means in this context see |[range]|.
  37.   
  38.   LOOPING OVER TAB PAGES:
  39.   
  40. *** ../vim-7.3.590/src/ex_cmds.h    2012-05-18 18:47:11.000000000 +0200
  41. --- src/ex_cmds.h    2012-07-06 18:10:13.000000000 +0200
  42. ***************
  43. *** 944,950 ****
  44.   EX(CMD_tabfirst,    "tabfirst",    ex_tabnext,
  45.               TRLBAR),
  46.   EX(CMD_tabmove,        "tabmove",    ex_tabmove,
  47. !             RANGE|NOTADR|ZEROR|COUNT|TRLBAR|ZEROR),
  48.   EX(CMD_tablast,        "tablast",    ex_tabnext,
  49.               TRLBAR),
  50.   EX(CMD_tabnext,        "tabnext",    ex_tabnext,
  51. --- 944,950 ----
  52.   EX(CMD_tabfirst,    "tabfirst",    ex_tabnext,
  53.               TRLBAR),
  54.   EX(CMD_tabmove,        "tabmove",    ex_tabmove,
  55. !             RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR),
  56.   EX(CMD_tablast,        "tablast",    ex_tabnext,
  57.               TRLBAR),
  58.   EX(CMD_tabnext,        "tabnext",    ex_tabnext,
  59. *** ../vim-7.3.590/src/ex_docmd.c    2012-06-06 19:02:40.000000000 +0200
  60. --- src/ex_docmd.c    2012-07-06 18:16:25.000000000 +0200
  61. ***************
  62. *** 7478,7484 ****
  63.   ex_tabmove(eap)
  64.       exarg_T    *eap;
  65.   {
  66. !     tabpage_move(eap->addr_count == 0 ? 9999 : (int)eap->line2);
  67.   }
  68.   
  69.   /*
  70. --- 7478,7519 ----
  71.   ex_tabmove(eap)
  72.       exarg_T    *eap;
  73.   {
  74. !     int tab_number = 9999;
  75. !     if (eap->arg && *eap->arg != NUL)
  76. !     {
  77. !     char_u *p = eap->arg;
  78. !     int    relative = 0; /* argument +N/-N means: move N places to the
  79. !                   * right/left relative to the current position. */
  80. !     if (*eap->arg == '-')
  81. !     {
  82. !         relative = -1;
  83. !         p = eap->arg + 1;
  84. !     }
  85. !     else if (*eap->arg == '+')
  86. !     {
  87. !         relative = 1;
  88. !         p = eap->arg + 1;
  89. !     }
  90. !     else
  91. !         p = eap->arg;
  92. !     if (p == skipdigits(p))
  93. !     {
  94. !         /* No numbers as argument. */
  95. !         eap->errmsg = e_invarg;
  96. !         return;
  97. !     }
  98. !     tab_number = getdigits(&p);
  99. !     if (relative != 0)
  100. !         tab_number = tab_number * relative + tabpage_index(curtab) - 1;;
  101. !     }
  102. !     else if (eap->addr_count != 0)
  103. !     tab_number = eap->line2;
  104. !     tabpage_move(tab_number);
  105.   }
  106.   
  107.   /*
  108. *** ../vim-7.3.590/src/testdir/test62.in    2012-03-07 22:55:17.000000000 +0100
  109. --- src/testdir/test62.in    2012-07-06 18:10:13.000000000 +0200
  110. ***************
  111. *** 93,98 ****
  112. --- 93,126 ----
  113.   :endif
  114.   :"
  115.   :"
  116. + :for i in range(9) | tabnew | endfor
  117. + 1gt
  118. + Go=tabpagenr()
  119.  
  120. + :tabmove 5
  121. + i=tabpagenr()
  122.  
  123. + :tabmove -2
  124. + i=tabpagenr()
  125.  
  126. + :tabmove +4
  127. + i=tabpagenr()
  128.  
  129. + :tabmove
  130. + i=tabpagenr()
  131.  
  132. + :tabmove -20
  133. + i=tabpagenr()
  134.  
  135. + :tabmove +20
  136. + i=tabpagenr()
  137.  
  138. + :3tabmove
  139. + i=tabpagenr()
  140.  
  141. + :7tabmove 5
  142. + i=tabpagenr()
  143.  
  144. + :let a='No error caught.'
  145. + :try
  146. + :tabmove foo
  147. + :catch E474
  148. + :let a='E474 caught.'
  149. + :endtry
  150. + i=a
  151. + :"
  152. + :"
  153.   :/^Results/,$w! test.out
  154.   :qa!
  155.   ENDTEST
  156. *** ../vim-7.3.590/src/testdir/test62.ok    2012-02-22 19:13:00.000000000 +0100
  157. --- src/testdir/test62.ok    2012-07-06 18:10:13.000000000 +0200
  158. ***************
  159. *** 8,10 ****
  160. --- 8,20 ----
  161.   tab drop 1: pass
  162.   tab drop 2: pass
  163.   tab drop 3: pass
  164. + 1
  165. + 6
  166. + 4
  167. + 8
  168. + 10
  169. + 1
  170. + 10
  171. + 4
  172. + 6
  173. + E474 caught.
  174. *** ../vim-7.3.590/src/window.c    2012-07-06 16:39:43.000000000 +0200
  175. --- src/window.c    2012-07-06 18:10:13.000000000 +0200
  176. ***************
  177. *** 3929,3935 ****
  178.       }
  179.   
  180.       /* Re-insert it at the specified position. */
  181. !     if (n == 0)
  182.       {
  183.       curtab->tp_next = first_tabpage;
  184.       first_tabpage = curtab;
  185. --- 3929,3935 ----
  186.       }
  187.   
  188.       /* Re-insert it at the specified position. */
  189. !     if (n <= 0)
  190.       {
  191.       curtab->tp_next = first_tabpage;
  192.       first_tabpage = curtab;
  193. *** ../vim-7.3.590/src/version.c    2012-07-06 17:51:24.000000000 +0200
  194. --- src/version.c    2012-07-06 18:11:08.000000000 +0200
  195. ***************
  196. *** 716,717 ****
  197. --- 716,719 ----
  198.   {   /* Add new patch number below this line */
  199. + /**/
  200. +     591,
  201.   /**/
  202.  
  203. -- 
  204. Bare feet magnetize sharp metal objects so they point upward from the
  205. floor -- especially in the dark.
  206.  
  207.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  208. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  209. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  210.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  211.