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