Hi Sergey,

Re execution background processes, what's wrong with :call system("cmd
/c start notepad")?

On Windows when you create a child process running a command-line program (such as Exuberant Ctags) a command prompt window automatically pops up. If you don't want this you have to explicitly request it using the CREATE_NO_WINDOW flag to CreateProcess() and Vim doesn't do this. Additionally because Vim uses the command-line program vimrun.exe* to wrap child processes created using the system() function, it will always (at least temporarily) show a command prompt window that (again temporarily) steals focus from Vim.

The reason those command prompts windows bother me is that my easytags.vim** plug-in runs Exuberant Ctags every time the CursorHold autocmd fires and the current buffer is newer (on disk) than the tags file. On UNIX this works great but on Windows it is horrible because command prompts keep popping up while you're typing. I noticed this myself when testing the easytags plug-in on Windows and also got feedback about this from users.

And URLs could be opened in the same way too: :call system("cmd /c
start http://www.vim.org";)

I knew this was possible, which is why the plug-in contains code to do this when the DLL isn't available. The reason I wrote openurl() was because your technique still opens a command-prompt window and I seem to remember that it would sometimes stay open for as long as my web browser was running. However I just checked in my Windows XP SP3 VM and the command prompt disappears in an instant both with Internet Explorer 8 as well as Mozilla Firefox 3.6 as the default web browser. I guess that makes the openurl() function inside the DLL moot :-)

 - Peter Odding

* http://vimdoc.sourceforge.net/htmldoc/gui_w32.html#win32-vimrun
** http://www.vim.org/scripts/script.php?script_id=3114

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