Skip to content
Browse files

fix s:WillComplete line prefix logic

fix case where user hits <tab> at the start of the line with trailing
characters (the line slice would wrap to the end of the line resulting
in a non empty prefix).

thanks to @char101 for catching this.
  • Loading branch information...
1 parent 22e4269 commit ee35ab6954a11337a2b52003d07fabe442843b68 @ervandew committed Jun 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugin/supertab.vim
View
2 plugin/supertab.vim
@@ -479,7 +479,7 @@ function! s:WillComplete()
let cnum = col('.')
" honor SuperTabNoCompleteAfter
- let pre = line[:cnum - 2]
+ let pre = cnum >= 2 ? line[:cnum - 2] : ''
for pattern in b:SuperTabNoCompleteAfter
if pre =~ pattern . '$'
return 0

0 comments on commit ee35ab6

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