]>
Commit | Line | Data |
---|---|---|
d02ad552 AG |
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 | + | |
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; | |
37 | + } | |
38 | buf->modified = buf->bufp->b_changed; | |
39 | /* =====================================================================*/ | |
40 | } | |
41 | *************** | |
42 | *** 1759,1765 **** | |
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); | |
47 | doupdate = 1; | |
48 | /* =====================================================================*/ | |
49 | } | |
50 | --- 1768,1775 ---- | |
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); | |
56 | doupdate = 1; | |
57 | /* =====================================================================*/ | |
58 | } | |
59 | *************** | |
60 | *** 2336,2342 **** | |
61 | nbbuf_T *nbbuf = nb_get_buf(bufno); | |
62 | char buffer[2*MAXPATHL]; | |
63 | ||
64 | ! if (!haveConnection) | |
65 | return; | |
66 | ||
67 | if (!netbeansCloseFile) | |
68 | --- 2346,2352 ---- | |
69 | nbbuf_T *nbbuf = nb_get_buf(bufno); | |
70 | char buffer[2*MAXPATHL]; | |
71 | ||
72 | ! if (!haveConnection || bufno < 0) | |
73 | return; | |
74 | ||
75 | if (!netbeansCloseFile) | |
76 | *************** | |
77 | *** 2526,2535 **** | |
78 | ||
79 | if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf) | |
80 | { | |
81 | - int lnum = curwin->w_cursor.lnum; | |
82 | int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1); | |
83 | ||
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"); | |
87 | } | |
88 | --- 2536,2551 ---- | |
89 | ||
90 | if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf) | |
91 | { | |
92 | int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1); | |
93 | + long off = pos2off(curbuf, &curwin->w_cursor); | |
94 | + | |
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]"); | |
99 | ||
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"); | |
104 | } | |
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 | |
107 | *************** | |
108 | *** 6134,6139 **** | |
109 | --- 6134,6148 ---- | |
110 | || cap->nchar == ']')) | |
111 | showmatch(); | |
112 | ++curwin->w_cursor.col; | |
113 | + #ifdef FEAT_NETBEANS_INTG | |
114 | + if (usingNetbeans) | |
115 | + { | |
116 | + colnr_T start = (colnr_T)(curwin->w_cursor.col | |
117 | + - cap->count1); | |
118 | + netbeans_inserted(curbuf, curwin->w_cursor.lnum, start, | |
119 | + (int)cap->count1, &ptr[start], (int)cap->count1); | |
120 | + } | |
121 | + #endif | |
122 | } | |
123 | ||
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 | |
127 | *************** | |
128 | *** 639,640 **** | |
129 | --- 639,642 ---- | |
130 | { /* Add new patch number below this line */ | |
131 | + /**/ | |
132 | + 199, | |
133 | /**/ | |
134 | ||
135 | -- | |
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 | |
143 | ||
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 /// |