4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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
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
25 if (streq((char *)args, "T"))
26 buf->bufp->b_changed = 1;
31 + /* Assume NetBeans stored the file. Reset the timestamp to
32 + * avoid "file changed" warnings. */
33 + if (buf->bufp->b_ffname != NULL
34 + && mch_stat((char *)buf->bufp->b_ffname, &st) >= 0)
35 + buf_store_time(buf->bufp, &st, buf->bufp->b_ffname);
36 buf->bufp->b_changed = 0;
38 buf->modified = buf->bufp->b_changed;
39 /* =====================================================================*/
43 nbdebug((" CLOSE %d: %s\n", bufno, name));
44 need_mouse_correct = TRUE;
45 if (buf->bufp != NULL)
46 ! close_buffer(NULL, buf->bufp, 0);
48 /* =====================================================================*/
51 nbdebug((" CLOSE %d: %s\n", bufno, name));
52 need_mouse_correct = TRUE;
53 if (buf->bufp != NULL)
54 ! do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD,
55 ! buf->bufp->b_fnum, TRUE);
57 /* =====================================================================*/
61 nbbuf_T *nbbuf = nb_get_buf(bufno);
62 char buffer[2*MAXPATHL];
64 ! if (!haveConnection)
67 if (!netbeansCloseFile)
69 nbbuf_T *nbbuf = nb_get_buf(bufno);
70 char buffer[2*MAXPATHL];
72 ! if (!haveConnection || bufno < 0)
75 if (!netbeansCloseFile)
79 if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
81 - int lnum = curwin->w_cursor.lnum;
82 int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
84 ! sprintf(buf, "%d:buttonRelease=%d %d %d %d\n", bufno, cmdno, button, lnum, col);
85 nbdebug(("EVT: %s", buf));
86 nb_send(buf, "netbeans_button_release");
90 if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
92 int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
93 + long off = pos2off(curbuf, &curwin->w_cursor);
95 + /* sync the cursor position */
96 + sprintf(buf, "%d:newDotAndMark=%d %ld %ld\n", bufno, cmdno, off, off);
97 + nbdebug(("EVT: %s", buf));
98 + nb_send(buf, "netbeans_button_release[newDotAndMark]");
100 ! sprintf(buf, "%d:buttonRelease=%d %d %ld %d\n", bufno, cmdno,
101 ! button, (long)curwin->w_cursor.lnum, col);
102 nbdebug(("EVT: %s", buf));
103 nb_send(buf, "netbeans_button_release");
105 *** ../vim-6.2.198/src/normal.c Sun Jan 18 21:31:56 2004
106 --- src/normal.c Thu Jan 22 16:50:57 2004
110 || cap->nchar == ']'))
112 ++curwin->w_cursor.col;
113 + #ifdef FEAT_NETBEANS_INTG
116 + colnr_T start = (colnr_T)(curwin->w_cursor.col
118 + netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
119 + (int)cap->count1, &ptr[start], (int)cap->count1);
124 /* mark the buffer as changed and prepare for displaying */
125 *** ../vim-6.2.198/src/version.c Sun Jan 25 19:35:19 2004
126 --- src/version.c Sun Jan 25 19:37:44 2004
130 { /* Add new patch number below this line */
136 FROG: How you English say: I one more time, mac, I unclog my nose towards
137 you, sons of a window-dresser, so, you think you could out-clever us
138 French fellows with your silly knees-bent creeping about advancing
139 behaviour. (blows a raspberry) I wave my private parts at your aunties,
140 you brightly-coloured, mealy-templed, cranberry-smelling, electric
141 donkey-bottom biters.
142 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
144 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
145 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
146 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
147 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///