Skip to content

vim plugin failing with "Unknown function: job_start" #1

@ghost

Description

  1. Starting with nvim & OSX
  2. Installed plugin with vim-plug; vim-plug reported success
  3. Open .go file
  4. nvim reports:
Error detected while processing function ABCGo:
line    1:
E117: Unknown function: job_start

It appears this ticket may be relevant.

I am not a vimscript hacker, but this code change seems to fix the issue:

diff --git a/vim/plugin/abcgo.vim b/vim/plugin/abcgo.vim
index 839fda4..36f68ba 100644
--- a/vim/plugin/abcgo.vim
+++ b/vim/plugin/abcgo.vim
@@ -33,7 +33,11 @@ function! ABCGoBackground(channel, reports)
 endfunction

 function! ABCGo()
-  call job_start($GOPATH . "/bin/abcgo -format raw -path " . expand("%:p"), {'callback': 'ABCGoBackground', 'mode': 'raw'})
+  if has("nvim")
+    call jobstart($GOPATH . "/bin/abcgo -format raw -path " . expand("%:p"), {'callback': 'ABCGoBackground', 'mode': 'raw'})
+  else
+    call job_start($GOPATH . "/bin/abcgo -format raw -path " . expand("%:p"), {'callback': 'ABCGoBackground', 'mode': 'raw'})
+  endif
 endfunction

 augroup abcgo_autocmd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions