@@ -23,7 +23,6 @@ type Options =
23
23
args: string list
24
24
program: string
25
25
stderrenc: System .Text .Encoding
26
- preArgs: string list
27
26
server: ServerOptions
28
27
}
29
28
@@ -61,15 +60,6 @@ let parseOptions (args: string[]) =
61
60
if wsl && ssh.IsSome then
62
61
failwith " --wsl and --ssh cannot be used together."
63
62
64
- let prog = if wsl then " wsl" elif ssh.IsSome then " ssh" else nvim
65
- let preargs = if wsl then [ " bash" ; " -l" ; " -c" ; " nvim" ] elif ssh.IsSome then [ ssh.Value; nvim] else []
66
- let enc = if wsl then System.Text.Encoding.Unicode else System.Text.Encoding.UTF8
67
-
68
- let intent =
69
- if setup then Setup
70
- elif runDaemon then Daemon( port, pipe)
71
- else Start
72
-
73
63
if terminal then
74
64
let set x = " +\" set " + x + " \" "
75
65
// fvim --wsl -u NORC +terminal +"set noshowmode" +"set laststatus=0" +"set noruler" +"set noshowcmd"
@@ -85,6 +75,33 @@ let parseOptions (args: string[]) =
85
75
| None -> " +terminal"
86
76
|> args.Add
87
77
78
+ let prog =
79
+ if wsl then
80
+ " wsl"
81
+ elif ssh.IsSome then
82
+ " ssh"
83
+ else
84
+ nvim
85
+
86
+ let args =
87
+ if wsl then
88
+ [ " bash" ; " -l" ; " -c" ; sprintf " nvim --embed %s " ( args |> escapeArgs |> join)]
89
+ elif ssh.IsSome then
90
+ [ ssh.Value; nvim; " --embed" ] @ ( List.ofSeq args)
91
+ else
92
+ [ " --embed" ] @ ( List.ofSeq args)
93
+
94
+ let enc =
95
+ if wsl then
96
+ System.Text.Encoding.Unicode
97
+ else
98
+ System.Text.Encoding.UTF8
99
+
100
+ let intent =
101
+ if setup then Setup
102
+ elif runDaemon then Daemon( port, pipe)
103
+ else Start
104
+
88
105
let serveropts =
89
106
if tryDaemon then
90
107
TryDaemon
@@ -100,9 +117,8 @@ let parseOptions (args: string[]) =
100
117
logToFile = trace_ to_ file
101
118
logPatterns = trace_ patterns
102
119
program = prog
103
- args = List.ofSeq args
120
+ args = args
104
121
server = serveropts
105
- preArgs = preargs
106
122
stderrenc = enc
107
123
intent = intent
108
124
}
0 commit comments