]>
Commit | Line | Data |
---|---|---|
16604d53 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.079 | |
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.2.079 | |
11 | Problem: "killed" netbeans events are not handled correctly. | |
12 | Solution: A "killed" netbeans event is sent when the buffer is deleted or | |
13 | wiped out (in this case, the netbeans annotations in this buffer | |
14 | have been removed). A user can still remove a sign with the | |
15 | command ":sign unplace" and this does not trigger a "killed" | |
16 | event. (Xavier de Gaye) | |
17 | Files: runtime/doc/netbeans.txt, src/buffer.c, src/globals.h, | |
18 | src/netbeans.c, src/proto/netbeans.pro | |
19 | ||
20 | ||
21 | *** ../vim-7.2.078/runtime/doc/netbeans.txt Sat Aug 9 19:36:49 2008 | |
22 | --- runtime/doc/netbeans.txt Tue Jan 6 15:23:39 2009 | |
23 | *************** | |
24 | *** 1,4 **** | |
25 | ! *netbeans.txt* For Vim version 7.2. Last change: 2008 Jun 28 | |
26 | ||
27 | ||
28 | VIM REFERENCE MANUAL by Gordon Prieur et al. | |
29 | --- 1,4 ---- | |
30 | ! *netbeans.txt* For Vim version 7.2. Last change: 2009 Jan 06 | |
31 | ||
32 | ||
33 | VIM REFERENCE MANUAL by Gordon Prieur et al. | |
34 | *************** | |
35 | *** 722,729 **** | |
36 | of the cursor. | |
37 | New in version 2.1. | |
38 | ||
39 | ! killed A file was closed by the user. Only for files that have been | |
40 | ! assigned a number by the IDE. | |
41 | ||
42 | newDotAndMark off off | |
43 | Reports the position of the cursor being at "off" bytes into | |
44 | --- 722,731 ---- | |
45 | of the cursor. | |
46 | New in version 2.1. | |
47 | ||
48 | ! killed A file was deleted or wiped out by the user and the buffer | |
49 | ! annotations have been removed. The bufID number for this | |
50 | ! buffer has become invalid. Only for files that have been | |
51 | ! assigned a bufID number by the IDE. | |
52 | ||
53 | newDotAndMark off off | |
54 | Reports the position of the cursor being at "off" bytes into | |
55 | *** ../vim-7.2.078/src/buffer.c Wed Dec 3 11:21:20 2008 | |
56 | --- src/buffer.c Tue Jan 6 15:23:02 2009 | |
57 | *************** | |
58 | *** 437,446 **** | |
59 | return; | |
60 | #endif | |
61 | ||
62 | - #ifdef FEAT_NETBEANS_INTG | |
63 | - if (usingNetbeans) | |
64 | - netbeans_file_closed(buf); | |
65 | - #endif | |
66 | /* Change directories when the 'acd' option is set. */ | |
67 | DO_AUTOCHDIR | |
68 | ||
69 | --- 437,442 ---- | |
70 | *************** | |
71 | *** 639,644 **** | |
72 | --- 635,644 ---- | |
73 | #ifdef FEAT_SIGNS | |
74 | buf_delete_signs(buf); /* delete any signs */ | |
75 | #endif | |
76 | + #ifdef FEAT_NETBEANS_INTG | |
77 | + if (usingNetbeans) | |
78 | + netbeans_file_killed(buf); | |
79 | + #endif | |
80 | #ifdef FEAT_LOCALMAP | |
81 | map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); /* clear local mappings */ | |
82 | map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); /* clear local abbrevs */ | |
83 | *************** | |
84 | *** 815,823 **** | |
85 | int bnr; /* buffer number */ | |
86 | char_u *p; | |
87 | ||
88 | - #ifdef FEAT_NETBEANS_INTG | |
89 | - netbeansCloseFile = 1; | |
90 | - #endif | |
91 | if (addr_count == 0) | |
92 | { | |
93 | (void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit); | |
94 | --- 815,820 ---- | |
95 | *************** | |
96 | *** 912,920 **** | |
97 | } | |
98 | } | |
99 | ||
100 | - #ifdef FEAT_NETBEANS_INTG | |
101 | - netbeansCloseFile = 0; | |
102 | - #endif | |
103 | ||
104 | return errormsg; | |
105 | } | |
106 | --- 909,914 ---- | |
107 | *** ../vim-7.2.078/src/globals.h Fri Nov 28 21:26:50 2008 | |
108 | --- src/globals.h Tue Jan 6 15:23:02 2009 | |
109 | *************** | |
110 | *** 1340,1346 **** | |
111 | ||
112 | #ifdef FEAT_NETBEANS_INTG | |
113 | EXTERN char *netbeansArg INIT(= NULL); /* the -nb[:host:port:passwd] arg */ | |
114 | - EXTERN int netbeansCloseFile INIT(= 0); /* send killed if != 0 */ | |
115 | EXTERN int netbeansFireChanges INIT(= 1); /* send buffer changes if != 0 */ | |
116 | EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */ | |
117 | EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */ | |
118 | --- 1340,1345 ---- | |
119 | *** ../vim-7.2.078/src/netbeans.c Wed Dec 24 12:20:10 2008 | |
120 | --- src/netbeans.c Tue Jan 6 15:23:02 2009 | |
121 | *************** | |
122 | *** 2921,2964 **** | |
123 | } | |
124 | ||
125 | /* | |
126 | ! * Tell netbeans a file was closed. | |
127 | */ | |
128 | void | |
129 | ! netbeans_file_closed(buf_T *bufp) | |
130 | { | |
131 | int bufno = nb_getbufno(bufp); | |
132 | nbbuf_T *nbbuf = nb_get_buf(bufno); | |
133 | char buffer[2*MAXPATHL]; | |
134 | ||
135 | ! if (!haveConnection || bufno < 0) | |
136 | return; | |
137 | ||
138 | ! if (!netbeansCloseFile) | |
139 | ! { | |
140 | ! nbdebug(("Ignoring file_closed for %s. File was closed from IDE\n", | |
141 | ! bufp->b_ffname)); | |
142 | ! return; | |
143 | ! } | |
144 | ! | |
145 | ! nbdebug(("netbeans_file_closed:\n")); | |
146 | ! nbdebug((" Closing bufno: %d", bufno)); | |
147 | ! if (curbuf != NULL && curbuf != bufp) | |
148 | ! { | |
149 | ! nbdebug((" Curbuf bufno: %d\n", nb_getbufno(curbuf))); | |
150 | ! } | |
151 | ! else if (curbuf == bufp) | |
152 | ! { | |
153 | ! nbdebug((" curbuf == bufp\n")); | |
154 | ! } | |
155 | ! | |
156 | ! if (bufno <= 0) | |
157 | ! return; | |
158 | ||
159 | sprintf(buffer, "%d:killed=%d\n", bufno, r_cmdno); | |
160 | ||
161 | nbdebug(("EVT: %s", buffer)); | |
162 | ||
163 | ! nb_send(buffer, "netbeans_file_closed"); | |
164 | ||
165 | if (nbbuf != NULL) | |
166 | nbbuf->bufp = NULL; | |
167 | --- 2921,2946 ---- | |
168 | } | |
169 | ||
170 | /* | |
171 | ! * Tell netbeans that a file was deleted or wiped out. | |
172 | */ | |
173 | void | |
174 | ! netbeans_file_killed(buf_T *bufp) | |
175 | { | |
176 | int bufno = nb_getbufno(bufp); | |
177 | nbbuf_T *nbbuf = nb_get_buf(bufno); | |
178 | char buffer[2*MAXPATHL]; | |
179 | ||
180 | ! if (!haveConnection || bufno == -1) | |
181 | return; | |
182 | ||
183 | ! nbdebug(("netbeans_file_killed:\n")); | |
184 | ! nbdebug((" Killing bufno: %d", bufno)); | |
185 | ||
186 | sprintf(buffer, "%d:killed=%d\n", bufno, r_cmdno); | |
187 | ||
188 | nbdebug(("EVT: %s", buffer)); | |
189 | ||
190 | ! nb_send(buffer, "netbeans_file_killed"); | |
191 | ||
192 | if (nbbuf != NULL) | |
193 | nbbuf->bufp = NULL; | |
194 | *** ../vim-7.2.078/src/proto/netbeans.pro Tue Jun 24 23:25:53 2008 | |
195 | --- src/proto/netbeans.pro Tue Jan 6 15:23:02 2009 | |
196 | *************** | |
197 | *** 11,17 **** | |
198 | void netbeans_frame_moved __ARGS((int new_x, int new_y)); | |
199 | void netbeans_file_activated __ARGS((buf_T *bufp)); | |
200 | void netbeans_file_opened __ARGS((buf_T *bufp)); | |
201 | ! void netbeans_file_closed __ARGS((buf_T *bufp)); | |
202 | void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, char_u *txt, int newlen)); | |
203 | void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len)); | |
204 | void netbeans_unmodified __ARGS((buf_T *bufp)); | |
205 | --- 11,17 ---- | |
206 | void netbeans_frame_moved __ARGS((int new_x, int new_y)); | |
207 | void netbeans_file_activated __ARGS((buf_T *bufp)); | |
208 | void netbeans_file_opened __ARGS((buf_T *bufp)); | |
209 | ! void netbeans_file_killed __ARGS((buf_T *bufp)); | |
210 | void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, char_u *txt, int newlen)); | |
211 | void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len)); | |
212 | void netbeans_unmodified __ARGS((buf_T *bufp)); | |
213 | *** ../vim-7.2.078/src/version.c Tue Jan 6 15:01:58 2009 | |
214 | --- src/version.c Tue Jan 6 16:11:11 2009 | |
215 | *************** | |
216 | *** 678,679 **** | |
217 | --- 678,681 ---- | |
218 | { /* Add new patch number below this line */ | |
219 | + /**/ | |
220 | + 79, | |
221 | /**/ | |
222 | ||
223 | -- | |
224 | Friends? I have lots of friends! In fact, I have every episode ever made. | |
225 | ||
226 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
227 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
228 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
229 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |