Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Completion bug fix: Off by one in prefix selection

  • Loading branch information...
commit 865c32f76c21fb0f2a3726e7df654dacd7db628c 1 parent 5d0ad12
Peter Odding authored June 18, 2011
8  autoload/xolox/lua.vim
@@ -288,7 +288,7 @@ endif
288 288
 
289 289
 function! xolox#lua#completefunc(init, base) " {{{1
290 290
   if a:init
291  
-    return s:get_completion_prefix()
  291
+    return s:getcompletionprefix()
292 292
   endif
293 293
   let items = []
294 294
   if xolox#lua#getopt('lua_complete_keywords', 1)
@@ -305,8 +305,8 @@ function! xolox#lua#completefunc(init, base) " {{{1
305 305
   return s:addsignatures(items)
306 306
 endfunction
307 307
 
308  
-function! s:get_completion_prefix()
309  
-  return match(strpart(getline('.'), 0, col('.') - 2), '\w\+\.\?\w*$')
  308
+function! s:getcompletionprefix()
  309
+  return match(strpart(getline('.'), 0, col('.') - 1), '\w\+\.\?\w*$')
310 310
 endfunction
311 311
 
312 312
 function! s:addsignatures(entries)
@@ -333,7 +333,7 @@ endfunction
333 333
 
334 334
 function! xolox#lua#omnifunc(init, base) " {{{1
335 335
   if a:init
336  
-    return s:get_completion_prefix()
  336
+    return s:getcompletionprefix()
337 337
   elseif !xolox#lua#getopt('lua_complete_omni', 0)
338 338
     throw printf("lua.vim %s: omni completion needs to be explicitly enabled, see the readme!", g:lua_ftplugin_version)
339 339
   endif
2  plugin/lua-ftplugin.vim
@@ -12,7 +12,7 @@ if &cp || exists('g:loaded_lua_ftplugin')
12 12
   finish
13 13
 endif
14 14
 
15  
-let g:lua_ftplugin_version = '0.6.16'
  15
+let g:lua_ftplugin_version = '0.6.17'
16 16
 
17 17
 " Commands to manually check for syntax errors and undefined globals.
18 18
 command! -bar LuaCheckSyntax call xolox#lua#checksyntax()

0 notes on commit 865c32f

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