home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.199 < prev    next >
Encoding:
Internet Message Format  |  2004-01-24  |  4.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.199
  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.199 (after 6.2.194)
  11. Problem:    Vim doesn't work perfectly well with NetBeans.
  12. Solution:   When NetBeans saves the file, reset the timestamp to avoid "file
  13.         changed" warnings.  Close a buffer in a proper way.  Don't try
  14.         giving a debug message with an invalid pointer.  Send a
  15.         newDotAndMark message when needed.  Report a change by the "r"
  16.         command to NetBeans.  (Gordon Prieur)
  17. Files:        src/netbeans.c, src/normal.c
  18.  
  19.  
  20. *** ../vim-6.2.198/src/netbeans.c    Sun Jan 18 21:31:56 2004
  21. --- src/netbeans.c    Wed Jan 21 10:58:28 2004
  22. ***************
  23. *** 1655,1661 ****
  24. --- 1655,1670 ----
  25.           if (streq((char *)args, "T"))
  26.           buf->bufp->b_changed = 1;
  27.           else
  28. +         {
  29. +         struct stat    st;
  30. +         /* Assume NetBeans stored the file.  Reset the timestamp to
  31. +          * avoid "file changed" warnings. */
  32. +         if (buf->bufp->b_ffname != NULL
  33. +             && mch_stat((char *)buf->bufp->b_ffname, &st) >= 0)
  34. +             buf_store_time(buf->bufp, &st, buf->bufp->b_ffname);
  35.           buf->bufp->b_changed = 0;
  36. +         }
  37.           buf->modified = buf->bufp->b_changed;
  38.   /* =====================================================================*/
  39.       }
  40. ***************
  41. *** 1759,1765 ****
  42.           nbdebug(("    CLOSE %d: %s\n", bufno, name));
  43.           need_mouse_correct = TRUE;
  44.           if (buf->bufp != NULL)
  45. !         close_buffer(NULL, buf->bufp, 0);
  46.           doupdate = 1;
  47.   /* =====================================================================*/
  48.       }
  49. --- 1768,1775 ----
  50.           nbdebug(("    CLOSE %d: %s\n", bufno, name));
  51.           need_mouse_correct = TRUE;
  52.           if (buf->bufp != NULL)
  53. !         do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD,
  54. !                              buf->bufp->b_fnum, TRUE);
  55.           doupdate = 1;
  56.   /* =====================================================================*/
  57.       }
  58. ***************
  59. *** 2336,2342 ****
  60.       nbbuf_T    *nbbuf = nb_get_buf(bufno);
  61.       char    buffer[2*MAXPATHL];
  62.   
  63. !     if (!haveConnection)
  64.       return;
  65.   
  66.       if (!netbeansCloseFile)
  67. --- 2346,2352 ----
  68.       nbbuf_T    *nbbuf = nb_get_buf(bufno);
  69.       char    buffer[2*MAXPATHL];
  70.   
  71. !     if (!haveConnection || bufno < 0)
  72.       return;
  73.   
  74.       if (!netbeansCloseFile)
  75. ***************
  76. *** 2526,2535 ****
  77.   
  78.       if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
  79.       {
  80. -     int lnum = curwin->w_cursor.lnum;
  81.       int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
  82.   
  83. !     sprintf(buf, "%d:buttonRelease=%d %d %d %d\n", bufno, cmdno, button, lnum, col);
  84.       nbdebug(("EVT: %s", buf));
  85.       nb_send(buf, "netbeans_button_release");
  86.       }
  87. --- 2536,2551 ----
  88.   
  89.       if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
  90.       {
  91.       int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
  92. +     long off = pos2off(curbuf, &curwin->w_cursor);
  93. +     /* sync the cursor position */
  94. +     sprintf(buf, "%d:newDotAndMark=%d %ld %ld\n", bufno, cmdno, off, off);
  95. +     nbdebug(("EVT: %s", buf));
  96. +     nb_send(buf, "netbeans_button_release[newDotAndMark]");
  97.   
  98. !     sprintf(buf, "%d:buttonRelease=%d %d %ld %d\n", bufno, cmdno,
  99. !                     button, (long)curwin->w_cursor.lnum, col);
  100.       nbdebug(("EVT: %s", buf));
  101.       nb_send(buf, "netbeans_button_release");
  102.       }
  103. *** ../vim-6.2.198/src/normal.c    Sun Jan 18 21:31:56 2004
  104. --- src/normal.c    Thu Jan 22 16:50:57 2004
  105. ***************
  106. *** 6134,6139 ****
  107. --- 6134,6148 ----
  108.                   || cap->nchar == ']'))
  109.               showmatch();
  110.           ++curwin->w_cursor.col;
  111. + #ifdef FEAT_NETBEANS_INTG
  112. +         if (usingNetbeans)
  113. +         {
  114. +             colnr_T start = (colnr_T)(curwin->w_cursor.col
  115. +                                    - cap->count1);
  116. +             netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
  117. +                  (int)cap->count1, &ptr[start], (int)cap->count1);
  118. +         }
  119. + #endif
  120.           }
  121.   
  122.           /* mark the buffer as changed and prepare for displaying */
  123. *** ../vim-6.2.198/src/version.c    Sun Jan 25 19:35:19 2004
  124. --- src/version.c    Sun Jan 25 19:37:44 2004
  125. ***************
  126. *** 639,640 ****
  127. --- 639,642 ----
  128.   {   /* Add new patch number below this line */
  129. + /**/
  130. +     199,
  131.   /**/
  132.  
  133. -- 
  134. FROG: How you English say:  I one more time, mac, I unclog my nose towards
  135.       you, sons of a window-dresser,  so, you think you could out-clever us
  136.       French fellows with your silly knees-bent creeping about advancing
  137.       behaviour.  (blows a raspberry) I wave my private parts at your aunties,
  138.       you brightly-coloured, mealy-templed, cranberry-smelling, electric
  139.       donkey-bottom biters.
  140.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  141.  
  142.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  143. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  144. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  145.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  146.