Hi,

I am working on this tutorial :
http://vim.wikia.com/wiki/Execute_external_programs_asynchronously_under_Windows


I have tried with the dir binary under windows to let people test the
example:

This is the launch command cmd :

let cmd = 'silent !start cmd /c "dir C:\Users\Admin /S > '.temp_file
        \ .' & vim --servername '.v:servername.' --remote-expr
"GetAsyncText('."'".temp_file."')\""
        \ .' & pause"'

        exec ''.cmd


Here is the GetAsyncText function :
function! GetAsyncText(temp_file_name)
  " original code
  " echomsg readfile(a:temp_file_name)[0]
  " call delete(a:temp_file_name)

   " set up the errorformat so Vim can parse the output
   let oldefm = &errorformat
   let &errorformat = &grepformat

   " parse the results into the quickfix window, but don't jump to the
first
   " search hit
   exec 'cgetfile '.a:temp_file_name

   " restore the previous state
   let &errorformat = oldefm
   call delete(a:temp_file_name)

   " the echomsg is mostly debug, but could be used instead of the
botright
   " copen to alert the user without interfering
   echomsg "got application output data ".a:temp_file_name

   " open the quickfix window but don't interfere with the user; jump
back to
   " the current window after opening the quickfix window
   botright copen
   wincmd p
   redraw

endfunction


The problem I got is that no output lines are retrieve into the copen
window.
Furthermore, it is not written in the tutorial but is this command can
retrieve along the spent time all output data ?

This feature is great and client server into vim is really powerful
but I fail to use it.

Thank you by advance for your help
Epanda

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

Reply via email to