Skip to content

Commit d108f3f

Browse files
author
Yatao Li
committed
fix argument escaping
1 parent 956af0f commit d108f3f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

common.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ let (|ForceBool|_|) (x:obj) =
9292
type hashmap<'a, 'b> = System.Collections.Generic.Dictionary<'a, 'b>
9393
let hashmap (xs: seq<'a*'b>) = new hashmap<'a,'b>(xs |> Seq.map (fun (a,b) -> System.Collections.Generic.KeyValuePair(a,b)))
9494

95+
let escapeArgs: string seq -> string seq = Seq.map (fun (x: string) -> if x.Contains(' ') then sprintf "\"%s\"" (x.Replace("\"", "\\\"")) else x)
9596
let join (xs: string seq) = System.String.Join(" ", xs)
9697

9798
let inline (>>=) (x: 'a option) (f: 'a -> 'b option) =

neovim/neovim.process.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type Nvim() =
5151
match serveropts with
5252
| StartNew ->
5353
let args = "--embed" :: args
54-
let psi = ProcessStartInfo(prog, join(preargs @ args))
54+
let psi = ProcessStartInfo(prog, (join << escapeArgs) (preargs @ args))
5555
psi.CreateNoWindow <- true
5656
psi.ErrorDialog <- false
5757
psi.RedirectStandardError <- true

0 commit comments

Comments
 (0)