Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Nov 18, 2020
1 parent 157737c commit fe46347
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions daemon.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let daemon (pname: string option) (nvim: string) (stderrenc: Text.Encoding) =
}
0

let fvrConnect (stdin: Stream) (verb: FVimRemoteVerb) =
let fvrConnect (stdin: Stream) (stdout: Stream) (verb: FVimRemoteVerb) =
let payload =
verb
|> Json.serialize
Expand All @@ -174,7 +174,7 @@ let fvrConnect (stdin: Stream) (verb: FVimRemoteVerb) =
stdin.Write(intbuf, 0, intbuf.Length)
stdin.Write(payload, 0, payload.Length)
stdin.Flush()
Async.StartAsTask(read stdin (intbuf.AsMemory())).Wait()
Async.StartAsTask(read stdout (intbuf.AsMemory())).Wait()
toInt32LE intbuf
with ex ->
trace "%O" ex
Expand Down
4 changes: 2 additions & 2 deletions neovim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type Nvim() =
let pipe = new System.IO.Pipes.NamedPipeClientStream(".", name, IO.Pipes.PipeDirection.InOut, IO.Pipes.PipeOptions.Asynchronous, TokenImpersonationLevel.Impersonation)
pipe.Connect()
trace "Connected, sending session request..."
let id = fvrConnect pipe verb
let id = fvrConnect pipe pipe verb
if id < 0 then
pipe.Dispose()
failwithf "Remote daemon closed the connection with error code %d" id
Expand All @@ -86,7 +86,7 @@ type Nvim() =
trace "Connecting to remote fvr session '%s'" paddr
let proc = newProcess prog (args @ [paddr]) Text.Encoding.UTF8
proc.Start() |> ignore
let id = fvrConnect proc.StandardInput.BaseStream verb
let id = fvrConnect proc.StandardInput.BaseStream proc.StandardOutput.BaseStream verb
if id < 0 then
proc.Kill()
failwithf "Remote daemon closed the connection with error code %d" id
Expand Down

0 comments on commit fe46347

Please sign in to comment.