On Wed, Nov 12, 2008 at 1:00 AM, Tony Mechelynck
<[EMAIL PROTECTED]> wrote:
> On 11/11/08 21:53, Bram Moolenaar wrote:
>>
>> Xavier de Gaye wrote:
>>
>>>>> On Sun, Nov 9, 2008 at 5:18 PM, Xavier de Gaye<[EMAIL PROTECTED]>
>>>>>  wrote:
>>>>>>
>>>>>> It is not clear if netbeans "killed" events are correctly sent by Vim.
>>>>>> ...
>>>>>> Conclusion:
>>>>>> As it is, "killed" events are useless for the netbeans application
>>>>>> (but they cannot be ignored as the bufno reference is not anymore
>>>>>> valid after receiving the event).
>>>>>> I would like to propose to remove the global netbeansCloseFile
>>>>>> entirely from the code, expecting that this would cause a "killed"
>>>>>> event whenever a buffer is not anymore visible in any window, but I
>>>>>> don't know Vim code sufficiently to be sure that this is the case.
>>>>>
>>>>> I have missed the following important point: the Vim signs placed in
>>>>> the buffer are removed by bdelete and by bwipeout, but not by bunload
>>>>> or by any other Vim command.
>>>>>
>>>>> The netbeans application must keep track of the Vim signs, so I
>>>>> suggest:
>>>>>     * the semantics of the "killed" event is:
>>>>>         the bufno reference is invalid
>>>>>         the signs have been removed by Vim
>>>>>     * the code is changed so that only bdelete and bwipeout
>>>>>       trigger a "killed" event (not bunload)
>>>>>     * the documentation is updated accordingly
>>>>
>>>> One wonders what the original meaning for "killed" is: buffer deleted or
>>>> unloaded?  I don't know.
>>>>
>>>> What is more useful?  Perhaps we need both a "killed" and an "unloaded"
>>>> event?
>>>
>>> Having "unloaded" events would be nice and would allow the netbeans
>>> application or IDE to know when a buffer is not visible.
>>>
>>> But the main problem is that Vim and the netbeans application must
>>> maintain the list of netbeans buffers and the corresponding signs
>>> (netbeans annotations) in a consistent state. So I think buffer
>>> deletion notifications (caused by bdelete and bwipeout commands, that
>>> remove the signs in a buffer) are needed and should be mapped to
>>> "killed" events.
>>
>> OK.  So a ":quit" will not cause a "killed" event.
>
> ...unless, maybe, the result is to exit Vim? (But this case ought to be
> covered by BufDelete.)

Actually, when ":quit" causes Vim to exit, "killed" events are
currently sent for each buffer known by netbeans, before the final
"disconnect" event that warns the application that netbeans is
terminating.



>>
>>> I think this can be fixed by calling netbeans_file_closed() from
>>> free_buffer_stuff(), just after buf_delete_signs(). This would cause a
>>> "killed" event to be sent when bdelete or bwipeout are invoked.
>>>
>>> What do you think ? I did not understand what issue is fixed by
>>> calling netbeans_file_closed() from buf_freeall(), in your other mail.
>>
>> It's just that calling netbeans_file_closed() from one place avoids that
>> it's not called when making changes.  But it may be called at the wrong
>> moment, one needs to inspect the code to check.


Xavier

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui