File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,10 @@ let fvrConnect (stdin: Stream) (stdout: Stream) (verb: FVimRemoteVerb) =
190190 stdin.Write( intbuf, 0 , intbuf.Length)
191191 stdin.Write( payload, 0 , payload.Length)
192192 stdin.Flush()
193- ( read stdout ( intbuf.AsMemory())) .Wait()
193+ // this doesn't drive the task:
194+ // (read stdout (intbuf.AsMemory())).Wait()
195+ // this *does* drive the task:
196+ read stdout ( intbuf.AsMemory()) |> Async.AwaitTask |> Async.StartImmediate
194197 toInt32LE intbuf
195198 with ex ->
196199 trace " %O " ex
Original file line number Diff line number Diff line change @@ -627,11 +627,17 @@ let OnTerminated () =
627627 trace " terminating nvim..."
628628 nvim.stop 1
629629
630+ let mutable _detaching = false
631+
630632let OnTerminating ( args : CancelEventArgs ) =
631- args.Cancel <- true
632633 trace " window is closing"
633- if nvim.isRemote then Detach()
634- else nvim.quitall() |> ignore
634+ if nvim.isRemote then
635+ if not _ detaching then
636+ _ detaching <- true
637+ Detach()
638+ else
639+ args.Cancel <- true
640+ nvim.quitall() |> ignore
635641
636642let OnExtClosed ( win : int ) =
637643 nvim.call { method = " nvim_win_close" ; parameters = mkparams2 win true }
You can’t perform that action at this time.
0 commit comments