4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
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
25 ! *netbeans.txt* For Vim version 7.2. Last change: 2008 Jun 28
28 VIM REFERENCE MANUAL by Gordon Prieur et al.
30 ! *netbeans.txt* For Vim version 7.2. Last change: 2009 Jan 06
33 VIM REFERENCE MANUAL by Gordon Prieur et al.
39 ! killed A file was closed by the user. Only for files that have been
40 ! assigned a number by the IDE.
43 Reports the position of the cursor being at "off" bytes into
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.
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
62 - #ifdef FEAT_NETBEANS_INTG
64 - netbeans_file_closed(buf);
66 /* Change directories when the 'acd' option is set. */
74 buf_delete_signs(buf); /* delete any signs */
76 + #ifdef FEAT_NETBEANS_INTG
78 + netbeans_file_killed(buf);
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 */
85 int bnr; /* buffer number */
88 - #ifdef FEAT_NETBEANS_INTG
89 - netbeansCloseFile = 1;
93 (void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit);
100 - #ifdef FEAT_NETBEANS_INTG
101 - netbeansCloseFile = 0;
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
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 */
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
126 ! * Tell netbeans a file was closed.
129 ! netbeans_file_closed(buf_T *bufp)
131 int bufno = nb_getbufno(bufp);
132 nbbuf_T *nbbuf = nb_get_buf(bufno);
133 char buffer[2*MAXPATHL];
135 ! if (!haveConnection || bufno < 0)
138 ! if (!netbeansCloseFile)
140 ! nbdebug(("Ignoring file_closed for %s. File was closed from IDE\n",
145 ! nbdebug(("netbeans_file_closed:\n"));
146 ! nbdebug((" Closing bufno: %d", bufno));
147 ! if (curbuf != NULL && curbuf != bufp)
149 ! nbdebug((" Curbuf bufno: %d\n", nb_getbufno(curbuf)));
151 ! else if (curbuf == bufp)
153 ! nbdebug((" curbuf == bufp\n"));
159 sprintf(buffer, "%d:killed=%d\n", bufno, r_cmdno);
161 nbdebug(("EVT: %s", buffer));
163 ! nb_send(buffer, "netbeans_file_closed");
171 ! * Tell netbeans that a file was deleted or wiped out.
174 ! netbeans_file_killed(buf_T *bufp)
176 int bufno = nb_getbufno(bufp);
177 nbbuf_T *nbbuf = nb_get_buf(bufno);
178 char buffer[2*MAXPATHL];
180 ! if (!haveConnection || bufno == -1)
183 ! nbdebug(("netbeans_file_killed:\n"));
184 ! nbdebug((" Killing bufno: %d", bufno));
186 sprintf(buffer, "%d:killed=%d\n", bufno, r_cmdno);
188 nbdebug(("EVT: %s", buffer));
190 ! nb_send(buffer, "netbeans_file_killed");
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
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));
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
218 { /* Add new patch number below this line */
224 Friends? I have lots of friends! In fact, I have every episode ever made.
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 ///