@@ -18,17 +18,17 @@ function! socketrepl#omnicomplete(findstart, base)
18
18
endif
19
19
endfunction
20
20
21
- function ! StartIfNotRunning ()
21
+ function ! s: StartIfNotRunning ()
22
22
if g: is_running == 0
23
23
echo ' Starting SocketREPL plugin...'
24
24
let jar_file_path = s: p_dir . ' /../' . ' socket-repl-plugin-0.1.0-standalone.jar'
25
25
call jobstart ([' java' , ' -jar' , jar_file_path], {' rpc' : v: true })
26
26
let g: is_running = 1
27
27
endif
28
28
endfunction
29
- command ! Start call StartIfNotRunning ()
29
+ command ! Start call s: StartIfNotRunning ()
30
30
31
- function ! Connect (host_colon_port, op_code)
31
+ function ! s: Connect (host_colon_port, op_code)
32
32
if a: host_colon_port == " "
33
33
let conn = " localhost:5555"
34
34
else
@@ -42,45 +42,45 @@ function! Connect(host_colon_port, op_code)
42
42
return res
43
43
endfunction
44
44
45
- function ! ReadyConnect (host_colon_port, op_code)
45
+ function ! s: ReadyConnect (host_colon_port, op_code)
46
46
if g: socket_repl_plugin_ready == 1
47
- call Connect (a: host_colon_port , a: op_code )
47
+ call s: Connect (a: host_colon_port , a: op_code )
48
48
else
49
49
echo s: not_ready
50
50
endif
51
51
endfunction
52
- command ! -nargs =? Connect call ReadyConnect (" <args>" , " connect" )
53
- command ! -nargs =? NConnect call ReadyConnect (" <args>" , " connect-nrepl" )
52
+ command ! -nargs =? Connect call s: ReadyConnect (" <args>" , " connect" )
53
+ command ! -nargs =? NConnect call s: ReadyConnect (" <args>" , " connect-nrepl" )
54
54
55
- function ! EvalBuffer ()
55
+ function ! s: EvalBuffer ()
56
56
ReplLog
57
57
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' eval-buffer' , [])
58
58
return res
59
59
endfunction
60
60
61
- function ! ReadyEvalBuffer ()
61
+ function ! s: ReadyEvalBuffer ()
62
62
if g: socket_repl_plugin_ready == 1
63
- call EvalBuffer ()
63
+ call s: EvalBuffer ()
64
64
else
65
65
echo s: not_ready
66
66
endif
67
67
endfunction
68
- command ! EvalBuffer call ReadyEvalBuffer ()
68
+ command ! EvalBuffer call s: ReadyEvalBuffer ()
69
69
70
- function ! EvalForm ()
70
+ function ! s: EvalForm ()
71
71
ReplLog
72
72
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' eval-form' , [])
73
73
return res
74
74
endfunction
75
75
76
- function ! ReadyEvalForm ()
76
+ function ! s: ReadyEvalForm ()
77
77
if g: socket_repl_plugin_ready == 1
78
- call EvalForm ()
78
+ call s: EvalForm ()
79
79
else
80
80
echo s: not_ready
81
81
endif
82
82
endfunction
83
- command ! EvalForm call ReadyEvalForm ()
83
+ command ! EvalForm call s: ReadyEvalForm ()
84
84
85
85
" Thanks vim-fireplace!
86
86
function ! socketrepl#eval_complete (A, L, P ) abort
@@ -89,7 +89,7 @@ function! socketrepl#eval_complete(A, L, P) abort
89
89
return sort (map (socketrepl#omnicomplete (0 , keyword ), ' prefix . v:val.word' ))
90
90
endfunction
91
91
92
- function ! Eval ()
92
+ function ! s: Eval ()
93
93
ReplLog
94
94
call inputsave ()
95
95
let form = input (' => ' , ' ' , ' customlist,socketrepl#eval_complete' )
@@ -98,42 +98,42 @@ function! Eval()
98
98
return res
99
99
endfunction
100
100
101
- function ! ReadyEval ()
101
+ function ! s: ReadyEval ()
102
102
if g: socket_repl_plugin_ready == 1
103
- call Eval ()
103
+ call s: Eval ()
104
104
else
105
105
echo s: not_ready
106
106
endif
107
107
endfunction
108
- command ! Eval call ReadyEval ()
108
+ command ! Eval call s: ReadyEval ()
109
109
110
- function ! ReplLog (buffer_cmd)
110
+ function ! s: ReplLog (buffer_cmd)
111
111
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' show-log' , a: buffer_cmd )
112
112
return res
113
113
endfunction
114
114
115
- function ! ReadyReplLog (buffer_cmd)
115
+ function ! s: ReadyReplLog (buffer_cmd)
116
116
if g: socket_repl_plugin_ready == 1
117
- call ReplLog (a: buffer_cmd )
117
+ call s: ReplLog (a: buffer_cmd )
118
118
else
119
119
echo s: not_ready
120
120
endif
121
121
endfunction
122
- command ! ReplLog call ReadyReplLog (' :botright new' )
122
+ command ! ReplLog call s: ReadyReplLog (' :botright new' )
123
123
124
- function ! DismissReplLog ()
124
+ function ! s: DismissReplLog ()
125
125
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' dismiss-log' , [])
126
126
return res
127
127
endfunction
128
128
129
- function ! ReadyDismissReplLog ()
129
+ function ! s: ReadyDismissReplLog ()
130
130
if g: socket_repl_plugin_ready == 1
131
- call DismissReplLog ()
131
+ call s: DismissReplLog ()
132
132
else
133
133
echo s: not_ready
134
134
endif
135
135
endfunction
136
- command ! DismissReplLog call ReadyDismissReplLog ()
136
+ command ! DismissReplLog call s: ReadyDismissReplLog ()
137
137
138
138
function ! s: Doc (symbol)
139
139
ReplLog
@@ -150,22 +150,22 @@ function! s:ReadyDoc(symbol)
150
150
endfunction
151
151
command ! - bar -nargs =1 -complete =customlist ,socketrepl#eval_complete Doc :exe s: ReadyDoc (<q-args> )
152
152
153
- function ! DocCursor ()
153
+ function ! s: DocCursor ()
154
154
ReplLog
155
155
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' doc-cursor' , [])
156
156
return res
157
157
endfunction
158
158
159
- function ! ReadyCursorDoc ()
159
+ function ! s: ReadyCursorDoc ()
160
160
if g: socket_repl_plugin_ready == 1
161
- call DocCursor ()
161
+ call s: DocCursor ()
162
162
else
163
163
echo s: not_ready
164
164
endif
165
165
endfunction
166
- command ! DocCursor call ReadyCursorDoc ()
166
+ command ! DocCursor call s: ReadyCursorDoc ()
167
167
168
- function ! Source ()
168
+ function ! s: Source ()
169
169
ReplLog
170
170
call inputsave ()
171
171
let symbol = input (' Source for: ' )
@@ -174,42 +174,42 @@ function! Source()
174
174
return res
175
175
endfunction
176
176
177
- function ! ReadySource ()
177
+ function ! s: ReadySource ()
178
178
if g: socket_repl_plugin_ready == 1
179
- call Source ()
179
+ call s: Source ()
180
180
else
181
181
echo s: not_ready
182
182
endif
183
183
endfunction
184
- command ! Source call ReadySource ()
184
+ command ! Source call s: ReadySource ()
185
185
186
- function ! SourceCursor ()
186
+ function ! s: SourceCursor ()
187
187
ReplLog
188
188
let res = rpcnotify (g: nvim_tcp_plugin_channel , ' source-cursor' , [])
189
189
return res
190
190
endfunction
191
191
192
- function ! ReadyCursorSource ()
192
+ function ! s: ReadyCursorSource ()
193
193
if g: socket_repl_plugin_ready == 1
194
- call SourceCursor ()
194
+ call s: SourceCursor ()
195
195
else
196
196
echo s: not_ready
197
197
endif
198
198
endfunction
199
- command ! SourceCursor call ReadyCursorSource ()
199
+ command ! SourceCursor call s: ReadyCursorSource ()
200
200
201
- function ! SwitchBufferNS ()
201
+ function ! s: SwitchBufferNS ()
202
202
call rpcnotify (g: nvim_tcp_plugin_channel , ' switch-buffer-ns' , [])
203
203
endfunction
204
204
205
- function ! ReadySwitchBufferNS ()
205
+ function ! s: ReadySwitchBufferNS ()
206
206
if g: socket_repl_plugin_ready == 1
207
- call SwitchBufferNS ()
207
+ call s: SwitchBufferNS ()
208
208
else
209
209
echo s: not_ready
210
210
endif
211
211
endfunction
212
- command ! SwitchBufferNS call ReadySwitchBufferNS ()
212
+ command ! SwitchBufferNS call s: ReadySwitchBufferNS ()
213
213
214
214
augroup socketrepl_completion
215
215
autocmd !
@@ -228,6 +228,6 @@ endif
228
228
229
229
if ! exists (' g:manually_start_socket_repl_plugin' )
230
230
if has (" nvim" )
231
- call StartIfNotRunning ()
231
+ call s: StartIfNotRunning ()
232
232
endif
233
233
endif
0 commit comments