parent
09c80c6794
commit
f456f04b65
@ -219,10 +219,6 @@ if !exists('s:repls')
|
||||
let s:repl_portfiles = {}
|
||||
endif
|
||||
|
||||
function! s:repl.user_ns() abort
|
||||
return 'user'
|
||||
endfunction
|
||||
|
||||
function! s:repl.path() dict abort
|
||||
return self.connection.path()
|
||||
endfunction
|
||||
@ -236,16 +232,6 @@ function! s:conn_try(connection, function, ...) abort
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:repl.eval(expr, options) dict abort
|
||||
if has_key(a:options, 'ns') && a:options.ns !=# self.user_ns()
|
||||
let error = self.preload(a:options.ns)
|
||||
if !empty(error)
|
||||
return error
|
||||
endif
|
||||
endif
|
||||
return s:conn_try(self.connection, 'eval', a:expr, a:options)
|
||||
endfunction
|
||||
|
||||
function! s:repl.message(payload, ...) dict abort
|
||||
if has_key(a:payload, 'ns') && a:payload.ns !=# self.user_ns()
|
||||
let ignored_error = self.preload(a:payload.ns)
|
||||
@ -321,6 +307,20 @@ function! s:piggieback.eval(expr, options) abort
|
||||
return call(s:repl.eval, [a:expr, options], self)
|
||||
endfunction
|
||||
|
||||
function! s:repl.user_ns() abort
|
||||
return 'user'
|
||||
endfunction
|
||||
|
||||
function! s:repl.eval(expr, options) dict abort
|
||||
if has_key(a:options, 'ns') && a:options.ns !=# self.user_ns()
|
||||
let error = self.preload(a:options.ns)
|
||||
if !empty(error)
|
||||
return error
|
||||
endif
|
||||
endif
|
||||
return s:conn_try(self.connection, 'eval', a:expr, a:options)
|
||||
endfunction
|
||||
|
||||
function! s:register_connection(conn, ...) abort
|
||||
call insert(s:repls, extend({'connection': a:conn, 'piggiebacks': []}, deepcopy(s:repl)))
|
||||
if a:0 && a:1 !=# ''
|
||||
|
Loading…
Reference in New Issue
Block a user