--- Bram Moolenaar wrote: > > Xavier de Gaye wrote: > > > Bug description: > > =============== > > Vim version 7.0 > > > > When receiving a netbeans 'close' command, vim does delete the > > specified buffer, but the buffer's reference (buf_list[bufno].bufp > > called here 'this_memory_address') is still kept in buf_list[]. > > It may happen that this_memory_address is once again returned by > > malloc when allocating a new buffer later. In this case, the function > > nb_getbufno(this_memory_address) will return the closed netbeans > > buffer number instead of the newly allocated one since it is always > > before in the list. > > > > See the test case below. > > The fix looks good to me. I'll include the patch and test it a bit. > > > Issue: > > How can a netbeans IDE implementation recognize when it talks to a vim > > version where the bug is fixed (since 'close' can't be used when it > > is not fixed) ? > > With a new netbeans version number ? > > Incrementing the netbeans interface version number for this doesn't > sound like a good idea. You could test for the patch number when it's > send out later: has("patch123")
Is there a better way to know what vim version + patches the IDE is talking to, than to do the processing that is equivalent to running the following shell commands ? $ cmd="let v=version | let p=has(\"patch123\") | let rc=append(line('0'), p) | let rc=append(line('0'), v)|wq" $ tmp=`mktemp`; echo $cmd | vim -e -s $tmp; cat $tmp; rm $tmp 700 0 Xavier -- http://clewn.sourceforge.net gdb support in Vim