Rename foreplay#eval to foreplay#eval_pr_str
Goal is to rename foreplay#evalparse to foreplay#eval.
This commit is contained in:
parent
b94a694254
commit
a6012b5032
@ -476,7 +476,7 @@ function! s:qfhistory() abort
|
||||
return list
|
||||
endfunction
|
||||
|
||||
function! foreplay#eval(expr) abort
|
||||
function! foreplay#eval_pr_str(expr) abort
|
||||
let response = s:eval(a:expr, {'session': 1})
|
||||
|
||||
if !empty(get(response, 'value', ''))
|
||||
@ -510,9 +510,13 @@ function! foreplay#eval(expr) abort
|
||||
throw err
|
||||
endfunction
|
||||
|
||||
function! foreplay#eval(expr) abort
|
||||
return foreplay#eval_pr_str(a:expr)
|
||||
endfunction
|
||||
|
||||
function! foreplay#eval_prn(expr) abort
|
||||
try
|
||||
echo foreplay#eval(a:expr)
|
||||
echo foreplay#eval_pr_str(a:expr)
|
||||
catch /^Clojure:/
|
||||
endtry
|
||||
return ''
|
||||
@ -583,7 +587,7 @@ function! s:filterop(type) abort
|
||||
let reg_save = @@
|
||||
try
|
||||
let expr = s:opfunc(a:type)
|
||||
let @@ = matchstr(expr, '^\n\+').foreplay#eval(expr).matchstr(expr, '\n\+$')
|
||||
let @@ = matchstr(expr, '^\n\+').foreplay#eval_pr_str(expr).matchstr(expr, '\n\+$')
|
||||
if @@ !~# '^\n*$'
|
||||
normal! gvp
|
||||
endif
|
||||
@ -634,7 +638,7 @@ function! s:Eval(bang, line1, line2, count, args) abort
|
||||
endif
|
||||
if a:bang
|
||||
try
|
||||
let result = foreplay#eval(expr)
|
||||
let result = foreplay#eval_pr_str(expr)
|
||||
if a:args !=# ''
|
||||
call append(a:line1, result)
|
||||
exe a:line1
|
||||
@ -702,7 +706,7 @@ function! s:recall() abort
|
||||
if input =~# '^(\=$'
|
||||
return ''
|
||||
else
|
||||
return foreplay#eval(input)
|
||||
return foreplay#eval_pr_str(input)
|
||||
endif
|
||||
catch /^Clojure:/
|
||||
return ''
|
||||
@ -807,7 +811,7 @@ function! s:Require(bang, ns)
|
||||
let cmd = ('(require '.s:qsym(a:ns ==# '' ? foreplay#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')')
|
||||
echo cmd
|
||||
try
|
||||
call foreplay#eval(cmd)
|
||||
call foreplay#eval_pr_str(cmd)
|
||||
return ''
|
||||
catch /^Clojure:.*/
|
||||
return ''
|
||||
@ -1000,7 +1004,7 @@ endfunction
|
||||
function! s:Lookup(ns, macro, arg) abort
|
||||
" doc is in clojure.core in older Clojure versions
|
||||
try
|
||||
call foreplay#eval("(require '".a:ns.") (clojure.core/eval (list (if (ns-resolve 'clojure.core '".a:macro.") 'clojure.core/".a:macro." '".a:ns.'/'.a:macro.") '".a:arg.'))')
|
||||
call foreplay#eval_pr_str("(require '".a:ns.") (clojure.core/eval (list (if (ns-resolve 'clojure.core '".a:macro.") 'clojure.core/".a:macro." '".a:ns.'/'.a:macro.") '".a:arg.'))')
|
||||
catch /^Clojure:/
|
||||
catch /.*/
|
||||
echohl ErrorMSG
|
||||
|
Loading…
Reference in New Issue
Block a user