Skip to content

Loading…

Avoid regexp error for foo(*args).baz pattern #98

Closed
wants to merge 1 commit into from

3 participants

@todesking

to reproduce:

foo(*args). # invoke omni completion here

@segfault segfault was assigned
@AndrewRadev
Vim-Ruby member

I'm afraid I'm not very familiar with the completion script, but from what I was able to understand, it seems like issue #120 manages to fix it in a slightly safer way. With this PR, I'm not entirely sure if GetRubyVarType could be called with something that's not quite \w+, like @foo or something, which is why I decided to merge in @sencer's solution.

In any case, thank you for your work, and sorry for the long wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 4, 2012
  1. @todesking
Showing with 3 additions and 1 deletion.
  1. +3 −1 autoload/rubycomplete.vim
View
4 autoload/rubycomplete.vim
@@ -355,8 +355,10 @@ class VimRubyCompletion
def get_var_type( receiver )
if /(\"|\')+/.match( receiver )
"String"
- else
+ elsif /^\w+$/.match( receiver ) # to avoid "*args" pattern
VIM::evaluate("s:GetRubyVarType('%s')" % receiver)
+ else
+ ''
end
end
Something went wrong with that request. Please try again.