]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.528
- new
[packages/vim.git] / 6.2.528
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.528
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.2.528
11 Problem:    NetBeans: Changes of the "~" command are not reported.
12 Solution:   Call netbeans_inserted() after performing "~". (Gordon Prieur)
13             Also change NetBeans debugging to append to the log file.
14             Also fix that "~" in Visual block mode changes too much if there
15             are multi-byte characters.
16 Files:      src/nbdebug.c, src/normal.c, src/ops.c
17
18
19 *** ../vim-6.2.527/src/nbdebug.c        Sun Oct 12 16:42:14 2003
20 --- src/nbdebug.c       Wed Apr 14 19:55:02 2004
21 ***************
22 *** 86,92 ****
23         if (log_var && (file = getenv(log_var)) != NULL) {
24                 time_t now;
25   
26 !               nb_debug = fopen(file, "w");
27                 time(&now);
28                 fprintf(nb_debug, "%s", asctime(localtime(&now)));
29                 if (level_var && (cp = getenv(level_var)) != NULL) {
30 --- 86,92 ----
31         if (log_var && (file = getenv(log_var)) != NULL) {
32                 time_t now;
33   
34 !               nb_debug = fopen(file, "a");
35                 time(&now);
36                 fprintf(nb_debug, "%s", asctime(localtime(&now)));
37                 if (level_var && (cp = getenv(level_var)) != NULL) {
38 *** ../vim-6.2.527/src/normal.c Mon Apr 19 20:26:43 2004
39 --- src/normal.c        Mon Apr 26 15:19:26 2004
40 ***************
41 *** 6460,6465 ****
42 --- 6460,6470 ----
43       long      n;
44       pos_T     startpos;
45       int               did_change = 0;
46 + #ifdef FEAT_NETBEANS_INTG
47 +     pos_T     pos;
48 +     char_u    *ptr;
49 +     int               count;
50 + #endif
51   
52       if (checkclearopq(cap->oap))
53         return;
54 ***************
55 *** 6476,6481 ****
56 --- 6481,6489 ----
57         return;
58   
59       startpos = curwin->w_cursor;
60 + #ifdef FEAT_NETBEANS_INTG
61 +     pos = startpos;
62 + #endif
63       for (n = cap->count1; n > 0; --n)
64       {
65         did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor);
66 ***************
67 *** 6485,6490 ****
68 --- 6493,6512 ----
69             if (vim_strchr(p_ww, '~') != NULL
70                     && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
71             {
72 + #ifdef FEAT_NETBEANS_INTG
73 +               if (usingNetbeans)
74 +               {
75 +                   if (did_change)
76 +                   {
77 +                       ptr = ml_get(pos.lnum);
78 +                       count = STRLEN(ptr) - pos.col;
79 +                       netbeans_inserted(curbuf, pos.lnum, pos.col,
80 +                                                count, &ptr[pos.col], count);
81 +                   }
82 +                   pos.col = 0;
83 +                   pos.lnum++;
84 +               }
85 + #endif
86                 ++curwin->w_cursor.lnum;
87                 curwin->w_cursor.col = 0;
88                 if (n > 1)
89 ***************
90 *** 6498,6503 ****
91 --- 6520,6535 ----
92                 break;
93         }
94       }
95 + #ifdef FEAT_NETBEANS_INTG
96 +     if (did_change && usingNetbeans)
97 +     {
98 +       ptr = ml_get(pos.lnum);
99 +       count = curwin->w_cursor.col - pos.col;
100 +       netbeans_inserted(curbuf, pos.lnum, pos.col,
101 +                                                count, &ptr[pos.col], count);
102 +     }
103 + #endif
104
105   
106       check_cursor();
107       curwin->w_set_curswant = TRUE;
108 *** ../vim-6.2.527/src/ops.c    Fri Apr 30 19:42:02 2004
109 --- src/ops.c   Wed May  5 10:34:02 2004
110 ***************
111 *** 2148,2155 ****
112 --- 2148,2159 ----
113       pos_T             pos;
114   #ifdef FEAT_VISUAL
115       struct block_def  bd;
116 +     int                       done;
117   #endif
118       int                       did_change = 0;
119 + #ifdef FEAT_MBYTE
120 +     colnr_T           col;
121 + #endif
122   
123       if (u_save((linenr_T)(oap->start.lnum - 1),
124                                        (linenr_T)(oap->end.lnum + 1)) == FAIL)
125 ***************
126 *** 2163,2174 ****
127         {
128             block_prep(oap, &bd, pos.lnum, FALSE);
129             pos.col = bd.textcol;
130 !           while (--bd.textlen >= 0)
131             {
132                 did_change |= swapchar(oap->op_type, &pos);
133                 if (inc(&pos) == -1)        /* at end of file */
134                     break;
135             }
136         }
137         if (did_change)
138             changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
139 --- 2167,2195 ----
140         {
141             block_prep(oap, &bd, pos.lnum, FALSE);
142             pos.col = bd.textcol;
143 !           for (done = 0; done < bd.textlen; ++done)
144             {
145                 did_change |= swapchar(oap->op_type, &pos);
146 + # ifdef FEAT_MBYTE
147 +               col = pos.col + 1;
148 + # endif
149                 if (inc(&pos) == -1)        /* at end of file */
150                     break;
151 + # ifdef FEAT_MBYTE
152 +               if (pos.col > col)
153 +                   /* Count extra bytes of a multi-byte character. */
154 +                   done += pos.col - col;
155 + # endif
156             }
157 + # ifdef FEAT_NETBEANS_INTG
158 +           if (usingNetbeans && did_change)
159 +           {
160 +               char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
161
162 +               netbeans_inserted(curbuf, pos.lnum, bd.textcol,
163 +                                   bd.textlen, &ptr[bd.textcol], bd.textlen);
164 +           }
165 + # endif
166         }
167         if (did_change)
168             changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
169 ***************
170 *** 2194,2201 ****
171 --- 2215,2246 ----
172                 break;
173         }
174         if (did_change)
175 +       {
176             changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
177                                                                           0L);
178 + #ifdef FEAT_NETBEANS_INTG
179 +           if (usingNetbeans && did_change)
180 +           {
181 +               char_u *ptr;
182 +               int count;
183
184 +               pos = oap->start;
185 +               while (pos.lnum < oap->end.lnum)
186 +               {
187 +                   ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
188 +                   count = STRLEN(ptr) - pos.col;
189 +                   netbeans_inserted(curbuf, pos.lnum, pos.col,
190 +                                                count, &ptr[pos.col], count);
191 +                   pos.col = 0;
192 +                   pos.lnum++;
193 +               }
194 +               ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
195 +               count = oap->end.col - pos.col + 1;
196 +               netbeans_inserted(curbuf, pos.lnum, pos.col,
197 +                                                count, &ptr[pos.col], count);
198 +           }
199 + #endif
200 +       }
201       }
202   
203   #ifdef FEAT_VISUAL
204 *** ../vim-6.2.527/src/version.c        Wed May  5 11:17:53 2004
205 --- src/version.c       Wed May  5 11:47:08 2004
206 ***************
207 *** 639,640 ****
208 --- 642,645 ----
209   {   /* Add new patch number below this line */
210 + /**/
211 +     528,
212   /**/
213
214 -- 
215 Nobody will ever need more than 640 kB RAM.
216                 -- Bill Gates, 1983
217 Windows 98 requires 16 MB RAM.
218                 -- Bill Gates, 1999
219 Logical conclusion: Nobody will ever need Windows 98.
220
221  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
222 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
223 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
224  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
This page took 0.041243 seconds and 3 git commands to generate.