Closed jrdoane closed 5 years ago
I may have fixed my own issue, but I'd like a second opinion to make sure. I updated the s:session_exists
function in vim-clojure-highlight
with this in my own fork:
https://github.com/jrdoane/vim-clojure-highlight
function! s:session_exists()
if exists('g:fireplace_nrepl_sessions') && len(g:fireplace_nrepl_sessions)
return 1
endif
" Fall through in case we're using a newer version of fireplace.
try
let client = fireplace#client()
return has_key(client, 'transport')
catch /./
endtry
return 0
endfunction
Where the original was just this:
function! s:session_exists()
return exists('g:fireplace_nrepl_sessions') && len(g:fireplace_nrepl_sessions)
endfunction
Does this look like an okay approach to see if an nrepl connection is available?
The old check was bad because all it tested for was the existence of a connection, regardless of whether it applied to the current buffer or not. I recommend using fireplace#op_available('eval')
for both old and new versions of Fireplace.
As of this commit
46b98b2317aa46cd426a3086591fe90529520e1b
, theg:fireplace_nrepl_sessions
variable was removed.vim-clojure-highlight
was using this to see if a nrepl connect had been established. Can the existence of a session be had another way sovim-clojure-highlight
can be updated with a fix?