Skip to content
Browse files

Don't try to complete if arguments list is empty.

  • Loading branch information...
1 parent 15c19c2 commit 127452acd133424d309bf2f0ef467d86119c6326 @jalvesaq jalvesaq committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 r-plugin/common_global.vim
View
8 r-plugin/common_global.vim
@@ -191,8 +191,11 @@ function RCompleteArgs()
else
exe 'Py SendToR("vimcom:::vim.args(' . "'" . rkeyword0 . "', '" . argkey . "', classfor = " . classfor . ")" . '")'
endif
- if g:rplugin_vimcomport > 0 && g:rplugin_lastrpl != "NOT_EXISTS" && g:rplugin_lastrpl != "NO_ARGS" && g:rplugin_lastrpl != "R is busy." && g:rplugin_lastrpl != "NOANSWER" && g:rplugin_lastrpl != "INVALID"
+ if g:rplugin_vimcomport > 0 && g:rplugin_lastrpl != "NOT_EXISTS" && g:rplugin_lastrpl != "NO_ARGS" && g:rplugin_lastrpl != "R is busy." && g:rplugin_lastrpl != "NOANSWER" && g:rplugin_lastrpl != "INVALID" && g:rplugin_lastrpl != ""
let args = []
+ if g:rplugin_lastrpl[0] == "\x04" && len(split(g:rplugin_lastrpl, "\x04")) == 1
+ return ''
+ endif
let tmp0 = split(g:rplugin_lastrpl, "\x04")
let tmp = split(tmp0[0], "\x09")
if(len(tmp) > 0)
@@ -220,6 +223,9 @@ function RCompleteArgs()
for omniL in flines
if omniL =~ rkeyword && omniL =~ "\x06function\x06function\x06"
let tmp1 = split(omniL, "\x06")
+ if len(tmp1) < 5
+ return ''
+ endif
let info = tmp1[4]
let argsL = split(info, "\x09")
let args = []

0 comments on commit 127452a

Please sign in to comment.
Something went wrong with that request. Please try again.