Skip to content

Commit fcd4fdc

Browse files
committed
Make Source command non-prompting
1 parent a159684 commit fcd4fdc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

plugin/socketrepl.vim

+5-7
Original file line numberDiff line numberDiff line change
@@ -165,23 +165,21 @@ function! s:ReadyCursorDoc()
165165
endfunction
166166
command! DocCursor call s:ReadyCursorDoc()
167167

168-
function! s:Source()
168+
function! s:Source(symbol)
169169
ReplLog
170-
call inputsave()
171-
let symbol = input('Source for: ')
172-
call inputrestore()
173-
let res = rpcnotify(g:nvim_tcp_plugin_channel, 'source', [symbol])
170+
let res = rpcnotify(g:nvim_tcp_plugin_channel, 'source', [a:symbol])
174171
return res
175172
endfunction
176173

177-
function! s:ReadySource()
174+
function! s:ReadySource(symbol)
178175
if g:socket_repl_plugin_ready == 1
179-
call s:Source()
176+
call s:Source(a:symbol)
180177
else
181178
echo s:not_ready
182179
endif
183180
endfunction
184181
command! Source call s:ReadySource()
182+
command! -bar -nargs=1 -complete=customlist,socketrepl#eval_complete Source :exe s:ReadySource(<q-args>)
185183

186184
function! s:SourceCursor()
187185
ReplLog

0 commit comments

Comments
 (0)