On Wed, Oct 26, 2011 at 11:12 AM, Bram Moolenaar <[email protected]> wrote:
>
> Benjamin Fritz wrote:
>
>> >> > I'm not sure what the problem is.  Why would there be FocusLost and
>> >> > FocusGained events for a system() call?
>> >> >
>> >>
>> >> Exactly. I was not expecting to see either event, but I see
>> >> FocusGained anyway (problem 1). So at the very least, I would expect
>> >> to see FocusLost to go with the FocusGained, but I do not (problem 2).
>> >> Trying to work around the the problem, I set eventignore to contain
>> >> FocusGained, and also tried setting it to "all", but cannot ignore the
>> >> FocusGained event (problem 3).
>> >>
>> >> The script given in the post is very simple but demonstrates the
>> >> problem well. Apparently it was not reproducible except on Windows.
>> >
>> > You probably get FocusGained because Vim checks for changed buffers when
>> > returning from an external command.  In a way it's true that Vim gets
>> > back control.
>> >
>> > - Bram
>> >
>>
>> Maybe, which is why I was OK with getting the events. After all, a
>> black console window pops up briefly on Windows when running most
>> (all?) external commands.
>>
>> But, I'd still expect to get FocusLost and FocusGained in pairs. And
>> barring that, I'd at least expect to be able to explicitly ignore one
>> or both of them by setting 'eventignore' properly.
>
> The script contains:
>
>        set ei=all
>        echomsg system("xterm -e 'echo system command; exit'")
>        set ei&
>
> The problem is that the autocommands trigger later.  The focus events
> are put in the type ahead buffer.  That's to avoid asynchronous
> autocommands causing trouble.
>

OK. So, how would one temporarily ignore Focus\(Lost\|Gained\) autocommands?

And, why don't we get FocusLost? I would expect never to get one
without the other.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui