Skip to content

Commit 58c7ff6

Browse files
Fix dispatch.vim integration
The command check must not include the <bang>. To ensure users are aware of this change, a warning is now emitted when dispatch isn't found.
1 parent a4c0b8a commit 58c7ff6

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

autoload/jack_in.vim

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
function! s:RunRepl(cmd)
2-
if exists(':Start!') == 2
3-
execute 'Start! '.a:cmd
1+
function! s:warn(str) abort
2+
echohl WarningMsg
3+
echomsg a:str
4+
echohl None
5+
let v:warningmsg = a:str
6+
endfunction
7+
8+
function! s:RunRepl(cmd) abort
9+
if exists(':Start') == 2
10+
execute 'Start!' a:cmd
411
else
5-
tabnew
6-
call termopen(a:cmd)
7-
tabprevious
12+
call s:warn('dispatch.vim not installed, please install it.')
13+
if has('nvim')
14+
call s:warn('neovim detected, falling back on termopen()')
15+
tabnew
16+
call termopen(a:cmd)
17+
tabprevious
18+
endif
819
endif
920
endfunction
1021

0 commit comments

Comments
 (0)