]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.194
- manpaged md5 fix
[packages/vim.git] / 6.2.194
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.194
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.194 (after 6.2.068)
11 Problem:    For NetBeans, instead of writing the file and sending an event
12             about it, tell NetBeans to write the file.
13 Solution:   Add the "save" command, "netbeansBuffer" command and
14             "buttonRelease" event to the netbeans protocol.  Updated the
15             interface to version 2.2.  (Gordon Prieur)
16             Also: open a fold when the cursor has been positioned.
17             Also: fix memory leak, free result of nb_quote().
18 Files:      runtime/doc/netbeans.txt, src/fileio.c, src/netbeans.c,
19             src/normal.c, src/proto/netbeans.pro, src/structs.h
20
21
22 *** ../vim-6.2.193/runtime/doc/netbeans.txt     Sun Oct 12 16:42:14 2003
23 --- runtime/doc/netbeans.txt    Sat Jan 17 16:38:31 2004
24 ***************
25 *** 1,4 ****
26 ! *netbeans.txt*  For Vim version 6.2.  Last change: 2003 Sep 12
27   
28   
29                   VIM REFERENCE MANUAL    by Gordon Prieur
30 --- 1,4 ----
31 ! *netbeans.txt*  For Vim version 6.2.  Last change: 2004 Jan 17
32   
33   
34                   VIM REFERENCE MANUAL    by Gordon Prieur
35 ***************
36 *** 14,21 ****
37   6.  Obtaining the External Editor Module      |obtaining-exted|
38   7.  Setting up NetBeans to run with Vim               |netbeans-setup|
39   8.  Messages                                  |netbeans-messages|
40 ! 9.  Running Vim from Netbeans                 |netbeans-run|
41 ! 10. Netbeans protocol                         |netbeans-protocol|
42   11. Known problems                            |netbeans-problems|
43   
44   {Vi does not have any of these features}
45 --- 14,21 ----
46   6.  Obtaining the External Editor Module      |obtaining-exted|
47   7.  Setting up NetBeans to run with Vim               |netbeans-setup|
48   8.  Messages                                  |netbeans-messages|
49 ! 9.  Running Vim from NetBeans                 |netbeans-run|
50 ! 10. NetBeans protocol                         |netbeans-protocol|
51   11. Known problems                            |netbeans-problems|
52   
53   {Vi does not have any of these features}
54 ***************
55 *** 26,32 ****
56   
57   NetBeans is an open source Integrated Development Environment developed
58   jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
59 ! Initialy just a Java IDE, NetBeans has had C, C++, and Fortran support added
60   in recent releases.
61   
62   For more information visit the main NetBeans web site http://www.netbeans.org
63 --- 26,32 ----
64   
65   NetBeans is an open source Integrated Development Environment developed
66   jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
67 ! Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
68   in recent releases.
69   
70   For more information visit the main NetBeans web site http://www.netbeans.org
71 ***************
72 *** 91,97 ****
73   
74   The Win32 support is now in beta stage.
75   
76 ! To use XPM signs on Win32 (e.g. when using with Netbeans) you can compile
77   XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/xpm
78   (for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
79   
80 --- 91,97 ----
81   
82   The Win32 support is now in beta stage.
83   
84 ! To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
85   XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/xpm
86   (for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
87   
88 ***************
89 *** 137,143 ****
90   Unfortunately, some versions do not have this module in their update
91   center. If you cannot download via the update center you will need to
92   download sources and build the module. I will try and get the module
93 ! available from the NetBeans Update Center so building will be unnecesary.
94   Also check http://externaleditor.netbeans.org for other availability options.
95   
96   To download the External Editor sources via CVS and build your own module,
97 --- 137,143 ----
98   Unfortunately, some versions do not have this module in their update
99   center. If you cannot download via the update center you will need to
100   download sources and build the module. I will try and get the module
101 ! available from the NetBeans Update Center so building will be unnecessary.
102   Also check http://externaleditor.netbeans.org for other availability options.
103   
104   To download the External Editor sources via CVS and build your own module,
105 ***************
106 *** 156,162 ****
107   an Expert tab. In the Properties tab make sure the "Editor Type" is set
108   to "Vim". In the Expert tab make sure the "Vim Command" is correct.
109   
110 ! You should be carefull if you change the "Vim Command". There are command
111   line options there which must be there for the connection to be properly
112   set up. You can change the command name but thats about it. If your gvim
113   can be found by your $PATH then the VIM Command can start with "gvim". If
114 --- 156,162 ----
115   an Expert tab. In the Properties tab make sure the "Editor Type" is set
116   to "Vim". In the Expert tab make sure the "Vim Command" is correct.
117   
118 ! You should be careful if you change the "Vim Command". There are command
119   line options there which must be there for the connection to be properly
120   set up. You can change the command name but thats about it. If your gvim
121   can be found by your $PATH then the VIM Command can start with "gvim". If
122 ***************
123 *** 172,208 ****
124   ==============================================================================
125   8. Messages                                           *netbeans-messages*
126   
127 ! These messages are specific for Netbeans:
128   
129                                                         *E463*
130   Region is guarded, cannot modify
131 !               Netbeans defines guarded areas in the text, which you cannot
132                 change.
133   
134   ==============================================================================
135 ! 9. Running Vim from Netbeans                          *netbeans-run*
136   
137 ! Netbeans starts Vim with the |-nb| argument.  The full form is: >
138         -nb:{hostname}:{addr}:{password}
139   
140 ! {hostname} is the name of the machine where Netbeans is running.  When omitted
141   the environment variable "__NETBEANS_HOST" is used or the default "localhost".
142   
143 ! {addr} is the port number for Netbeans.  When omitted the environment variable
144   "__NETBEANS_SOCKET" is used or the default 3219.
145   
146 ! {password} is the password for connecting to Netbeans.  When omitted the
147   environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
148   
149   ==============================================================================
150 ! 10. Netbeans protocol                                 *netbeans-protocol*
151   
152 ! The communication between Netbeans and Vim uses plain text messages.  This
153   protocol was first designed to work with the external editor module of
154 ! Netbeans (see http://externaleditor.netbeans.org).  Later it was extended to
155   work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org).  The extensions are
156   marked with "version 2.1".
157   
158   The messages are currently sent over a socket.  Since the messages are in
159   plain UTF-8 text this protocol could also be used with any other communication
160   mechanism.
161 --- 172,228 ----
162   ==============================================================================
163   8. Messages                                           *netbeans-messages*
164   
165 ! These messages are specific for NetBeans:
166   
167                                                         *E463*
168   Region is guarded, cannot modify
169 !               NetBeans defines guarded areas in the text, which you cannot
170                 change.
171   
172 +                                                       *E656*
173 + NetBeans dissallows writes of unmodified buffers
174 +               NetBeans does not support writes of unmodified buffers that
175 +               were opened from NetBeans.
176
177 +                                                       *E657*
178 + Partial writes disallowed for NetBeans buffers
179 +               NetBeans does not support partial writes for buffers that were
180 +               opened from NetBeans.
181
182   ==============================================================================
183 ! 9. Running Vim from NetBeans                          *netbeans-run*
184   
185 ! NetBeans starts Vim with the |-nb| argument.  The full form is: >
186         -nb:{hostname}:{addr}:{password}
187   
188 ! {hostname} is the name of the machine where NetBeans is running.  When omitted
189   the environment variable "__NETBEANS_HOST" is used or the default "localhost".
190   
191 ! {addr} is the port number for NetBeans.  When omitted the environment variable
192   "__NETBEANS_SOCKET" is used or the default 3219.
193   
194 ! {password} is the password for connecting to NetBeans.  When omitted the
195   environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
196   
197   ==============================================================================
198 ! 10. NetBeans protocol                                 *netbeans-protocol*
199   
200 ! The communication between NetBeans and Vim uses plain text messages.  This
201   protocol was first designed to work with the external editor module of
202 ! NetBeans (see http://externaleditor.netbeans.org).  Later it was extended to
203   work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org).  The extensions are
204   marked with "version 2.1".
205   
206 + Version 2.2 of the protocol has several minor changes which should only
207 + affect NetBeans users (ie, not Agide users). However, a bug was fixed which
208 + could cause confusion. The netbeans_saved() function sent a "save" protocol
209 + command. In protocol version 2.1 and earlier this was incorrectly interpreted
210 + as a notification that a write had taken place. In reality, it told NetBeans
211 + to save the file so multiple writes were being done. This caused various
212 + problems and has been fixed in 2.2. To decrease the likelyhood of this
213 + confusion happening again, netbeans_saved() has been renamed to
214 + netbeans_save_buffer().
215
216   The messages are currently sent over a socket.  Since the messages are in
217   plain UTF-8 text this protocol could also be used with any other communication
218   mechanism.
219 ***************
220 *** 304,310 ****
221                    typeNum      number  sequence number of the annotation
222                                         defined with defineAnnoType for this
223                                         buffer
224 !                  off          number  offset where annotion is to be placed
225                    len          number  not used
226                 In version 2.1 "lnum/col" can be used instead of "off".
227   
228 --- 324,330 ----
229                    typeNum      number  sequence number of the annotation
230                                         defined with defineAnnoType for this
231                                         buffer
232 !                  off          number  offset where annotation is to be placed
233                    len          number  not used
234                 In version 2.1 "lnum/col" can be used instead of "off".
235   
236 ***************
237 *** 316,322 ****
238   
239   create                Creates a buffer without a name.  Replaces the current buffer
240                 (it's hidden when it was changed).
241 !               Netbeans uses this as the first command for a file that is
242                 being opened.  The sequence of commands could be:
243                         create
244                         setCaretListener        (ignored)
245 --- 336,342 ----
246   
247   create                Creates a buffer without a name.  Replaces the current buffer
248                 (it's hidden when it was changed).
249 !               NetBeans uses this as the first command for a file that is
250                 being opened.  The sequence of commands could be:
251                         create
252                         setCaretListener        (ignored)
253 ***************
254 *** 374,383 ****
255   moveAnnoToFront serNum
256                 Not implemented.
257   
258   putBufferNumber pathname
259                 Associate a buffer number with the Vim buffer by the name
260                 "pathname", a string argument.  To be used when the editor
261 !               repored editing another file to the IDE and the IDE needs to
262                 tell the editor what buffer number it will use for this file.
263                 Also marks the buffer as initialized.
264                 New in version 2.1.
265 --- 394,408 ----
266   moveAnnoToFront serNum
267                 Not implemented.
268   
269 + netbeansBuffer isNetbeansBuffer
270 +               If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by
271 +               NetBeans.
272 +               New in version 2.2.
273
274   putBufferNumber pathname
275                 Associate a buffer number with the Vim buffer by the name
276                 "pathname", a string argument.  To be used when the editor
277 !               reported editing another file to the IDE and the IDE needs to
278                 tell the editor what buffer number it will use for this file.
279                 Also marks the buffer as initialized.
280                 New in version 2.1.
281 ***************
282 *** 389,394 ****
283 --- 414,429 ----
284                 Remove a previously place annotation for this buffer.
285                 "serNum" is the same number used in addAnno.
286   
287 + save          Save the buffer when it was modified.  The other side of the
288 +               interface is expected to write the buffer and invoke
289 +               "setModified" to reset the "changed" flag of the buffer.
290 +               The writing is skipped when one of these conditions is true:
291 +               - 'write' is not set
292 +               - the buffer is read-only
293 +               - the buffer does not have a file name
294 +               - 'buftype' disallows writing
295 +               New in version 2.2.
296
297   setAsUser     Not implemented.
298   
299   setBufferNumber pathname
300 ***************
301 *** 435,441 ****
302   
303   setTitle name
304                 Set the title for the buffer to "name", a string argument.
305 !               The title is only used for Netbeans functions, not by Vim.
306   
307   setVisible visible
308                 When the boolean argument "visible" is "T", goto the buffer.
309 --- 470,476 ----
310   
311   setTitle name
312                 Set the title for the buffer to "name", a string argument.
313 !               The title is only used for NetBeans functions, not by Vim.
314   
315   setVisible visible
316                 When the boolean argument "visible" is "T", goto the buffer.
317 ***************
318 *** 550,555 ****
319 --- 585,599 ----
320                 the mouse pointer.
321                 New in version 2.1.
322   
323 + buttonRelease button lnum col
324 +               Report which button was pressed and the location of the cursor
325 +               at the time of the release.  Only for buffers that are owned
326 +               by NetBeans.  This event is not sent if the button was
327 +               released while the mouse was in the status line or in a
328 +               separator line. If col is less than 1 the button release was
329 +               in the sign area.
330 +               New in version 2.2.
331
332   fileClosed    Not implemented.
333   
334   fileModified  Not implemented.
335 ***************
336 *** 558,564 ****
337                 A file was opened by the user.
338                 Arguments:
339                    pathname     string    name of the file
340 !                  open         boolean   always "F"
341                    modified     boolean   always "F"
342   
343   geometry cols rows x y
344 --- 602,608 ----
345                 A file was opened by the user.
346                 Arguments:
347                    pathname     string    name of the file
348 !                  open         boolean   always "T"
349                    modified     boolean   always "F"
350   
351   geometry cols rows x y
352 ***************
353 *** 630,636 ****
354                 Only fired when enabled, see "startDocumentListen".
355   
356   version vers  Report the version of the interface implementation.  Vim
357 !               reports "2.1" (including the quotes).
358   
359   
360   10.6 Special messages                                 *nb-special*
361 --- 674,680 ----
362                 Only fired when enabled, see "startDocumentListen".
363   
364   version vers  Report the version of the interface implementation.  Vim
365 !               reports "2.2" (including the quotes).
366   
367   
368   10.6 Special messages                                 *nb-special*
369 *** ../vim-6.2.193/src/fileio.c Sun Jan 18 21:04:53 2004
370 --- src/fileio.c        Thu Jan 15 22:07:40 2004
371 ***************
372 *** 2658,2663 ****
373 --- 2658,2691 ----
374       }
375   #endif
376   
377 + #ifdef FEAT_NETBEANS_INTG
378 +     if (usingNetbeans && isNetbeansBuffer(buf))
379 +     {
380 +       if (whole)
381 +       {
382 +           if (buf->b_changed)
383 +           {
384 +               netbeans_save_buffer(buf);
385 +               return retval;
386 +           }
387 +           else
388 +           {
389 +               errnum = (char_u *)"E656: ";
390 +               errmsg = (char_u *)_("NetBeans dissallows writes of unmodified buffers");
391 +               buffer = NULL;
392 +               goto fail;
393 +           }
394 +       }
395 +       else
396 +       {
397 +           errnum = (char_u *)"E657: ";
398 +           errmsg = (char_u *)_("Partial writes disallowed for NetBeans buffers");
399 +           buffer = NULL;
400 +           goto fail;
401 +       }
402 +     }
403 + #endif
404
405       if (shortmess(SHM_OVER) && !exiting)
406         msg_scroll = FALSE;         /* overwrite previous file message */
407       else
408 ***************
409 *** 3900,3908 ****
410       {
411         unchanged(buf, TRUE);
412         u_unchanged(buf);
413 - #ifdef FEAT_NETBEANS_INTG
414 -       netbeans_saved(buf);
415 - #endif
416       }
417   
418       /*
419 --- 3928,3933 ----
420 *** ../vim-6.2.193/src/netbeans.c       Mon Dec 29 20:14:44 2003
421 --- src/netbeans.c      Tue Jan 13 13:55:27 2004
422 ***************
423 *** 62,68 ****
424   
425   /* The first implementation (working only with Netbeans) returned "1.1".  The
426    * protocol implemented here also supports A-A-P. */
427 ! static char *ExtEdProtocolVersion = "2.1";
428   
429   static long pos2off __ARGS((buf_T *, pos_T *));
430   static pos_T *off2pos __ARGS((buf_T *, long));
431 --- 62,68 ----
432   
433   /* The first implementation (working only with Netbeans) returned "1.1".  The
434    * protocol implemented here also supports A-A-P. */
435 ! static char *ExtEdProtocolVersion = "2.2";
436   
437   static long pos2off __ARGS((buf_T *, pos_T *));
438   static pos_T *off2pos __ARGS((buf_T *, long));
439 ***************
440 *** 719,724 ****
441 --- 719,726 ----
442   
443       cmdno = strtol((char *)q, (char **)&q, 10);
444   
445 +     q = skipwhite(q);
446
447       if (nb_do_cmd(bufno, verb, isfunc, cmdno, q) == FAIL)
448       {
449         nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd));
450 ***************
451 *** 774,779 ****
452 --- 776,790 ----
453   }
454   
455   /*
456 +  * Is this a NetBeans-owned buffer?
457 +  */
458 +     int
459 + isNetbeansBuffer(buf_T *bufp)
460 + {
461 +     return bufp->b_netbeans_file;
462 + }
463
464 + /*
465    * Given a Netbeans buffer number, return the netbeans buffer.
466    * Returns NULL for 0 or a negative number. A 0 bufno means a
467    * non-buffer related command has been sent.
468 ***************
469 *** 1010,1016 ****
470   
471       if (*p++ != '"')
472       {
473 !       nbdebug(("nb_unquote called with string that doesn't start with a quote!: %s", p));
474         result[0] = NUL;
475         return result;
476       }
477 --- 1021,1028 ----
478   
479       if (*p++ != '"')
480       {
481 !       nbdebug(("nb_unquote called with string that doesn't start with a quote!: %s\n",
482 !                       p));
483         result[0] = NUL;
484         return result;
485       }
486 ***************
487 *** 1311,1317 ****
488             off = strtol((char *)args, (char **)&args, 10);
489   
490             /* get text to be inserted */
491 !           ++args; /* skip space */
492             args = to_free = (char_u *)nb_unquote(args, NULL);
493   
494             if (buf == NULL || buf->bufp == NULL)
495 --- 1323,1329 ----
496             off = strtol((char *)args, (char **)&args, 10);
497   
498             /* get text to be inserted */
499 !           args = skipwhite(args);
500             args = to_free = (char_u *)nb_unquote(args, NULL);
501   
502             if (buf == NULL || buf->bufp == NULL)
503 ***************
504 *** 1494,1500 ****
505                 return FAIL;
506             }
507             vim_free(buf->displayname);
508 !           buf->displayname = nb_unquote(++args, NULL);
509             nbdebug(("    SETTITLE %d %s\n", bufno, buf->displayname));
510   /* =====================================================================*/
511         }
512 --- 1506,1512 ----
513                 return FAIL;
514             }
515             vim_free(buf->displayname);
516 !           buf->displayname = nb_unquote(args, NULL);
517             nbdebug(("    SETTITLE %d %s\n", bufno, buf->displayname));
518   /* =====================================================================*/
519         }
520 ***************
521 *** 1528,1534 ****
522                 EMSG("E641: null buf in setBufferNumber");
523                 return FAIL;
524             }
525 !           to_free = (char_u *)nb_unquote(++args, NULL);
526             if (to_free == NULL)
527                 return FAIL;
528             bufp = buflist_findname(to_free);
529 --- 1540,1546 ----
530                 EMSG("E641: null buf in setBufferNumber");
531                 return FAIL;
532             }
533 !           to_free = (char_u *)nb_unquote(args, NULL);
534             if (to_free == NULL)
535                 return FAIL;
536             bufp = buflist_findname(to_free);
537 ***************
538 *** 1567,1573 ****
539                 return FAIL;
540             }
541             vim_free(buf->displayname);
542 !           buf->displayname = nb_unquote(++args, NULL);
543             nbdebug(("    SETFULLNAME %d %s\n", bufno, buf->displayname));
544   
545             netbeansReadFile = 0; /* don't try to open disk file */
546 --- 1579,1585 ----
547                 return FAIL;
548             }
549             vim_free(buf->displayname);
550 !           buf->displayname = nb_unquote(args, NULL);
551             nbdebug(("    SETFULLNAME %d %s\n", bufno, buf->displayname));
552   
553             netbeansReadFile = 0; /* don't try to open disk file */
554 ***************
555 *** 1588,1594 ****
556             }
557             /* Edit a file: like create + setFullName + read the file. */
558             vim_free(buf->displayname);
559 !           buf->displayname = nb_unquote(++args, NULL);
560             nbdebug(("    EDITFILE %d %s\n", bufno, buf->displayname));
561             do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
562                                                      ECMD_HIDE + ECMD_OLDBUF);
563 --- 1600,1606 ----
564             }
565             /* Edit a file: like create + setFullName + read the file. */
566             vim_free(buf->displayname);
567 !           buf->displayname = nb_unquote(args, NULL);
568             nbdebug(("    EDITFILE %d %s\n", bufno, buf->displayname));
569             do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
570                                                      ECMD_HIDE + ECMD_OLDBUF);
571 ***************
572 *** 1603,1609 ****
573         }
574         else if (streq((char *)cmd, "setVisible"))
575         {
576 -           ++args;
577             if (buf == NULL || buf->bufp == NULL)
578             {
579   /*            EMSG("E645: null bufp in setVisible"); */
580 --- 1615,1620 ----
581 ***************
582 *** 1636,1642 ****
583         }
584         else if (streq((char *)cmd, "setModified"))
585         {
586 -           ++args;
587             if (buf == NULL || buf->bufp == NULL)
588             {
589   /*            EMSG("E646: null bufp in setModified"); */
590 --- 1647,1652 ----
591 ***************
592 *** 1667,1673 ****
593             if (balloonEval != NULL)
594             {
595                 vim_free(text);
596 !               text = nb_unquote(++args, NULL);
597                 if (text != NULL)
598                     gui_mch_post_balloon(balloonEval, (char_u *)text);
599             }
600 --- 1677,1683 ----
601             if (balloonEval != NULL)
602             {
603                 vim_free(text);
604 !               text = nb_unquote(args, NULL);
605                 if (text != NULL)
606                     gui_mch_post_balloon(balloonEval, (char_u *)text);
607             }
608 ***************
609 *** 1681,1687 ****
610             char_u *s;
611   #endif
612   
613 -           ++args;
614             if (buf == NULL || buf->bufp == NULL)
615             {
616                 EMSG("E647: null bufp in setDot");
617 --- 1691,1696 ----
618 ***************
619 *** 1997,2002 ****
620 --- 2006,2051 ----
621             }
622   /* =====================================================================*/
623         }
624 +       else if (streq((char *)cmd, "save"))
625 +       {
626 +           if (buf == NULL || buf->bufp == NULL)
627 +           {
628 +               nbdebug(("    null bufp in %s command", cmd));
629 +               return FAIL;
630 +           }
631
632 +           /* the following is taken from ex_cmds.c (do_wqall function) */
633 +           if (bufIsChanged(buf->bufp))
634 +           {
635 +               /* Only write if the buffer can be written. */
636 +               if (p_write
637 +                       && !buf->bufp->b_p_ro
638 +                       && buf->bufp->b_ffname != NULL
639 + #ifdef FEAT_QUICKFIX
640 +                       && !bt_dontwrite(buf->bufp)
641 + #endif
642 +                       )
643 +               {
644 +                   buf_write_all(buf->bufp, FALSE);
645 + #ifdef FEAT_AUTOCMD
646 +                   /* an autocommand may have deleted the buffer */
647 +                   if (!buf_valid(buf->bufp))
648 +                       buf->bufp = NULL;
649 + #endif
650 +               }
651 +           }
652 + /* =====================================================================*/
653 +       }
654 +       else if (streq((char *)cmd, "netbeansBuffer"))
655 +       {
656 +           if (buf == NULL || buf->bufp == NULL)
657 +           {
658 +               nbdebug(("    null bufp in %s command", cmd));
659 +               return FAIL;
660 +           }
661 +           buf->bufp->b_netbeans_file = *args == 'T' ? TRUE : FALSE;
662 + /* =====================================================================*/
663 +       }
664         else if (streq((char *)cmd, "version"))
665         {
666             nbdebug(("    Version = %s\n", (char *) args));
667 ***************
668 *** 2266,2272 ****
669       sprintf(buffer, "0:fileOpened=%d \"%s\" %s %s\n",
670             0,
671             (char *)q,
672 !           "F",  /* open in NetBeans */
673             "F"); /* modified */
674   
675       vim_free(q);
676 --- 2315,2321 ----
677       sprintf(buffer, "0:fileOpened=%d \"%s\" %s %s\n",
678             0,
679             (char *)q,
680 !           "T",  /* open in NetBeans */
681             "F"); /* modified */
682   
683       vim_free(q);
684 ***************
685 *** 2464,2469 ****
686 --- 2513,2542 ----
687   }
688   
689   /*
690 +  * Send a button release event back to netbeans. Its up to netbeans
691 +  * to decide what to do (if anything) with this event.
692 +  */
693 +     void
694 + netbeans_button_release(int button)
695 + {
696 +     char      buf[128];
697 +     int               bufno;
698
699 +     bufno = nb_getbufno(curbuf);
700
701 +     if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
702 +     {
703 +       int lnum = curwin->w_cursor.lnum;
704 +       int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
705
706 +       sprintf(buf, "%d:buttonRelease=%d %d %d %d\n", bufno, cmdno, button, lnum, col);
707 +       nbdebug(("EVT: %s", buf));
708 +       nb_send(buf, "netbeans_button_release");
709 +     }
710 + }
711
712
713 + /*
714    * Send a keypress event back to netbeans. This usualy simulates some
715    * kind of function key press.
716    */
717 ***************
718 *** 2532,2538 ****
719    * Send a save event to netbeans.
720    */
721       void
722 ! netbeans_saved(buf_T *bufp)
723   {
724       char_u    buf[64];
725       int               bufno;
726 --- 2605,2611 ----
727    * Send a save event to netbeans.
728    */
729       void
730 ! netbeans_save_buffer(buf_T *bufp)
731   {
732       char_u    buf[64];
733       int               bufno;
734 ***************
735 *** 2546,2552 ****
736   
737       sprintf((char *)buf, "%d:save=%d\n", bufno, cmdno);
738       nbdebug(("EVT: %s", buf));
739 !     nb_send((char *)buf, "netbeans_saved");
740   }
741   
742   
743 --- 2619,2625 ----
744   
745       sprintf((char *)buf, "%d:save=%d\n", bufno, cmdno);
746       nbdebug(("EVT: %s", buf));
747 !     nb_send((char *)buf, "netbeans_save_buffer");
748   }
749   
750   
751 *** ../vim-6.2.193/src/normal.c Sun Jan 18 21:27:18 2004
752 --- src/normal.c        Sun Jan 18 18:49:04 2004
753 ***************
754 *** 2473,2478 ****
755 --- 2473,2490 ----
756       in_sep_line = (jump_flags & IN_SEP_LINE);
757   #endif
758   
759 + #ifdef FEAT_NETBEANS_INTG
760 +     if (usingNetbeans && isNetbeansBuffer(curbuf)
761 +                           && !(jump_flags & (IN_STATUS_LINE | IN_SEP_LINE)))
762 +     {
763 +       int key = KEY2TERMCAP1(c);
764
765 +       if (key == (int)KE_LEFTRELEASE || key == (int)KE_MIDDLERELEASE
766 +                                              || key == (int)KE_RIGHTRELEASE)
767 +           netbeans_button_release(which_button);
768 +     }
769 + #endif
770
771       /* When jumping to another window, clear a pending operator.  That's a bit
772        * friendlier than beeping and not jumping to that window. */
773       if (curwin != old_curwin && oap != NULL && oap->op_type != OP_NOP)
774 *** ../vim-6.2.193/src/proto/netbeans.pro       Sun Oct 12 16:42:14 2003
775 --- src/proto/netbeans.pro      Tue Jan 13 13:48:34 2004
776 ***************
777 *** 3,8 ****
778 --- 3,9 ----
779   void netbeans_gtk_connect __ARGS((void));
780   void netbeans_w32_connect __ARGS((void));
781   void messageFromNetbeansW32 __ARGS((void));
782 + int isNetbeansBuffer __ARGS((buf_T *bufp));
783   void netbeans_end __ARGS((void));
784   void netbeans_startup_done __ARGS((void));
785   void netbeans_frame_moved __ARGS((int new_x, int new_y));
786 ***************
787 *** 11,18 ****
788   void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, int oldlen, char_u *txt, int newlen));
789   void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
790   void netbeans_unmodified __ARGS((buf_T *bufp));
791   void netbeans_keycommand __ARGS((int key));
792 ! void netbeans_saved __ARGS((buf_T *bufp));
793   void netbeans_deleted_all_lines __ARGS((buf_T *bufp));
794   int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot));
795   void netbeans_draw_multisign_indicator __ARGS((int row));
796 --- 12,20 ----
797   void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, int oldlen, char_u *txt, int newlen));
798   void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
799   void netbeans_unmodified __ARGS((buf_T *bufp));
800 + void netbeans_button_release __ARGS((int button));
801   void netbeans_keycommand __ARGS((int key));
802 ! void netbeans_save_buffer __ARGS((buf_T *bufp));
803   void netbeans_deleted_all_lines __ARGS((buf_T *bufp));
804   int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot));
805   void netbeans_draw_multisign_indicator __ARGS((int row));
806 *** ../vim-6.2.193/src/structs.h        Sun Jan 18 21:12:26 2004
807 --- src/structs.h       Tue Jan 13 12:57:23 2004
808 ***************
809 *** 1233,1238 ****
810 --- 1233,1242 ----
811       signlist_T        *b_signlist;    /* list of signs to draw */
812   #endif
813   
814 + #ifdef FEAT_NETBEANS_INTG
815 +     int               b_netbeans_file;    /* TRUE when buffer is owned by NetBeans */
816 + #endif
817
818   };
819   
820   /*
821 *** ../vim-6.2.193/src/version.c        Sun Jan 18 21:27:18 2004
822 --- src/version.c       Sun Jan 18 21:29:39 2004
823 ***************
824 *** 639,640 ****
825 --- 639,642 ----
826   {   /* Add new patch number below this line */
827 + /**/
828 +     194,
829   /**/
830
831 -- 
832 `When any government, or any church for that matter, undertakes to say to
833  its subjects, "This you may not read, this you must not see, this you are
834  forbidden to know," the end result is tyranny and oppression no matter how
835  holy the motives' -- Robert A Heinlein, "If this goes on --"
836
837  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
838 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
839 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
840  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
This page took 0.089743 seconds and 3 git commands to generate.