Skip to content

Commit

Permalink
send [0, "init connection"] to go server to get initial connection
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Aug 29, 2016
1 parent 7f90242 commit 00aef1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vimserver.go
Expand Up @@ -26,13 +26,13 @@ func (p *Process) Close() error {
return p.cmd.Process.Signal(os.Interrupt)
}

// send [0, "init connection"] to go server to get initial connection.
const connectScript = `
call ch_logfile('/tmp/vimchannellog', 'w')
while 1
let g:vim_server_handler = ch_open('{{ .Addr }}')
if ch_status(g:vim_server_handler) is# 'open'
echo 'open!'
call ch_sendexpr(g:vim_server_handler, 'connect')
let g:vim_go_client_handler = ch_open('{{ .Addr }}')
if ch_status(g:vim_go_client_handler) is# 'open'
call ch_sendraw(g:vim_go_client_handler, "[0, \"init connection\"]\n")
break
endif
sleep 50ms
Expand Down

0 comments on commit 00aef1d

Please sign in to comment.