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.

-- 
hundred-and-one symptoms of being an internet addict:
92. It takes you two hours to check all 14 of your mailboxes.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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