Fix naming inconsistency
This commit is contained in:
parent
bfdd052fc7
commit
b10259bcca
@ -14,15 +14,15 @@ endfunction
|
|||||||
|
|
||||||
" Bencode {{{1
|
" Bencode {{{1
|
||||||
|
|
||||||
function! nrepl#fireplace_connection#bencode(value) abort
|
function! fireplace#nrepl_connection#bencode(value) abort
|
||||||
if type(a:value) == type(0)
|
if type(a:value) == type(0)
|
||||||
return 'i'.a:value.'e'
|
return 'i'.a:value.'e'
|
||||||
elseif type(a:value) == type('')
|
elseif type(a:value) == type('')
|
||||||
return strlen(a:value).':'.a:value
|
return strlen(a:value).':'.a:value
|
||||||
elseif type(a:value) == type([])
|
elseif type(a:value) == type([])
|
||||||
return 'l'.join(map(copy(a:value),'nrepl#fireplace_connection#bencode(v:val)'),'').'e'
|
return 'l'.join(map(copy(a:value),'fireplace#nrepl_connection#bencode(v:val)'),'').'e'
|
||||||
elseif type(a:value) == type({})
|
elseif type(a:value) == type({})
|
||||||
return 'd'.join(values(map(copy(a:value),'nrepl#fireplace_connection#bencode(v:key).nrepl#fireplace_connection#bencode(v:val)')),'').'e'
|
return 'd'.join(values(map(copy(a:value),'fireplace#nrepl_connection#bencode(v:key).fireplace#nrepl_connection#bencode(v:val)')),'').'e'
|
||||||
else
|
else
|
||||||
throw "Can't bencode ".string(a:value)
|
throw "Can't bencode ".string(a:value)
|
||||||
endif
|
endif
|
||||||
@ -54,11 +54,11 @@ function! s:id() abort
|
|||||||
return 'fireplace-'.hostname().'-'.s:vim_id.'-'.s:id
|
return 'fireplace-'.hostname().'-'.s:vim_id.'-'.s:id
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! nrepl#fireplace_connection#prompt() abort
|
function! fireplace#nrepl_connection#prompt() abort
|
||||||
return fireplace#input_host_port()
|
return fireplace#input_host_port()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! nrepl#fireplace_connection#open(arg) abort
|
function! fireplace#nrepl_connection#open(arg) abort
|
||||||
if a:arg =~# '^\d\+$'
|
if a:arg =~# '^\d\+$'
|
||||||
let host = 'localhost'
|
let host = 'localhost'
|
||||||
let port = a:arg
|
let port = a:arg
|
||||||
@ -88,7 +88,7 @@ function! s:nrepl_transport_command(cmd, args) dict abort
|
|||||||
\ . ' ' . s:shellesc(self.port)
|
\ . ' ' . s:shellesc(self.port)
|
||||||
\ . ' ' . s:shellesc(s:keepalive)
|
\ . ' ' . s:shellesc(s:keepalive)
|
||||||
\ . ' ' . s:shellesc(a:cmd)
|
\ . ' ' . s:shellesc(a:cmd)
|
||||||
\ . ' ' . join(map(copy(a:args), 's:shellesc(nrepl#fireplace_connection#bencode(v:val))'), ' ')
|
\ . ' ' . join(map(copy(a:args), 's:shellesc(fireplace#nrepl_connection#bencode(v:val))'), ' ')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:nrepl_transport_dispatch(cmd, ...) dict abort
|
function! s:nrepl_transport_dispatch(cmd, ...) dict abort
|
||||||
@ -101,7 +101,7 @@ function! s:nrepl_transport_dispatch(cmd, ...) dict abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:nrepl_transport_call(msg, terms, sels, ...) dict abort
|
function! s:nrepl_transport_call(msg, terms, sels, ...) dict abort
|
||||||
let payload = nrepl#fireplace_connection#bencode(a:msg)
|
let payload = fireplace#nrepl_connection#bencode(a:msg)
|
||||||
let response = self.dispatch('call', payload, a:terms, a:sels)
|
let response = self.dispatch('call', payload, a:terms, a:sels)
|
||||||
if !a:0
|
if !a:0
|
||||||
return response
|
return response
|
@ -266,7 +266,7 @@ function! fireplace#register_port_file(portfile, ...) abort
|
|||||||
let port = matchstr(readfile(a:portfile, 'b', 1)[0], '\d\+')
|
let port = matchstr(readfile(a:portfile, 'b', 1)[0], '\d\+')
|
||||||
let s:repl_portfiles[a:portfile] = {'time': getftime(a:portfile)}
|
let s:repl_portfiles[a:portfile] = {'time': getftime(a:portfile)}
|
||||||
try
|
try
|
||||||
let conn = nrepl#fireplace_connection#open(port)
|
let conn = fireplace#nrepl_connection#open(port)
|
||||||
let s:repl_portfiles[a:portfile].connection = conn
|
let s:repl_portfiles[a:portfile].connection = conn
|
||||||
call s:register_connection(conn, a:0 ? a:1 : '')
|
call s:register_connection(conn, a:0 ? a:1 : '')
|
||||||
return conn
|
return conn
|
||||||
@ -312,7 +312,7 @@ function! s:connect_complete(A, L, P) abort
|
|||||||
else
|
else
|
||||||
let rest = matchstr(a:A, '://\zs.*')
|
let rest = matchstr(a:A, '://\zs.*')
|
||||||
try
|
try
|
||||||
let options = {proto}#fireplace_connection#complete(rest)
|
let options = fireplace#{proto}_connection#complete(rest)
|
||||||
catch /^Vim(let):E117/
|
catch /^Vim(let):E117/
|
||||||
let options = ['localhost:']
|
let options = ['localhost:']
|
||||||
endtry
|
endtry
|
||||||
|
Loading…
Reference in New Issue
Block a user