Skip to content

Commit

Permalink
feat: Add elin#status function for vim
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Nov 10, 2024
1 parent 984c391 commit bad2b28
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions autoload/elin.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,32 @@ function! elin#ready() abort
endfunction

function! elin#intercept_notify(...) abort
if elin#server#connection() is# v:null
if !elin#server#is_connected()
return v:null
endif
return elin#notify('elin.handler.internal/intercept', a:000)
endfunction

function! elin#intercept_request(...) abort
if elin#server#connection() is# v:null
if !elin#server#is_connected()
return v:null
endif
return elin#request('elin.handler.internal/intercept', a:000)
endfunction

function! s:update_status_text(resp) abort
let g:elin#status_text = a:resp
endfunction

function! elin#status() abort
try
if !elin#server#is_connected()
return ''
endif

call elin#request_async('elin.handler.internal/status', [], funcref('s:update_status_text'))
return g:elin#status_text
catch
return ''
endtry
endfunction

0 comments on commit bad2b28

Please sign in to comment.