Hello!

I've attached a script which illustrates the problem.

  vim -u NONE -N prblm.vim
  :so %
  :q  (in the gvim that's showing prblm.vim, NOT the remote gvim)

Behavior:

  * a remote server gvim shows up (this happens)
* a message "verify its working" shows up in the server's message line (this happens) * both the client vim quits (this happens) AND the remote server gvim quits (this does NOT happen)

The remote server gvim should quit because of an autocmd VimLeave event:

   au VimLeave call <SID>RemoteSend(":qa!")

I've tried this with "s:" instead of <SID> and it still doesn't work.

Hope y'all can duplicate this!

Regards,
Chip Campbell

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

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
fun! s:Remote()

  if !has("clientserver")
   echohl ERROR
   echo " routines need clientserver to work, which your vim lacks")
   echohl NONE
   return
  endif

  if serverlist() !~ '\<MYSERVER\>'
   " start up MYSERVER server
   if has("win32") && executable("start")
        call system("start gvim --servername MYSERVER")
   else
        call system("gvim -u NONE -U NONE -N --servername MYSERVER")
   endif
   call s:RemoteSend(":filetype plugin on")
   call s:RemoteSend(":syn on")
  endif

  if has("clientserver")
   augroup PCHKEVENT
    au!
        au VimLeave call <SID>RemoteSend(":qa!")
   augroup END
  endif

endfun

fun! s:RemoteSend(msg)

  if a:msg =~ '^:'
   let msg= a:msg."\<cr>"
  elseif a:msg =~ '^\*'
   let msg= strpart(a:msg,1)."\<cr>"
  else
   let msg= ':exe "norm '.a:msg."\"\<cr>"
  endif

  while 1
        try
         call remote_send("MYSERVER",msg,"s:server")
         break
        catch /^Vim\%((\a\+)\)\=:E241/
         sleep 200m
        endtry
  endwhile

  return s:server
endfun

au VimLeave call s:RemoteSend(":qa!")
call s:Remote()         " open the remote MYSERVER server
call s:RemoteSend(':echo "verify its working"')

Raspunde prin e-mail lui