Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Completion bug fix: Off by one in prefix selection

  • Loading branch information...
commit 865c32f76c21fb0f2a3726e7df654dacd7db628c 1 parent 5d0ad12
Peter Odding authored
Showing with 5 additions and 5 deletions.
  1. +4 −4 autoload/xolox/lua.vim
  2. +1 −1  plugin/lua-ftplugin.vim
8 autoload/xolox/lua.vim
View
@@ -288,7 +288,7 @@ endif
function! xolox#lua#completefunc(init, base) " {{{1
if a:init
- return s:get_completion_prefix()
+ return s:getcompletionprefix()
endif
let items = []
if xolox#lua#getopt('lua_complete_keywords', 1)
@@ -305,8 +305,8 @@ function! xolox#lua#completefunc(init, base) " {{{1
return s:addsignatures(items)
endfunction
-function! s:get_completion_prefix()
- return match(strpart(getline('.'), 0, col('.') - 2), '\w\+\.\?\w*$')
+function! s:getcompletionprefix()
+ return match(strpart(getline('.'), 0, col('.') - 1), '\w\+\.\?\w*$')
endfunction
function! s:addsignatures(entries)
@@ -333,7 +333,7 @@ endfunction
function! xolox#lua#omnifunc(init, base) " {{{1
if a:init
- return s:get_completion_prefix()
+ return s:getcompletionprefix()
elseif !xolox#lua#getopt('lua_complete_omni', 0)
throw printf("lua.vim %s: omni completion needs to be explicitly enabled, see the readme!", g:lua_ftplugin_version)
endif
2  plugin/lua-ftplugin.vim
View
@@ -12,7 +12,7 @@ if &cp || exists('g:loaded_lua_ftplugin')
finish
endif
-let g:lua_ftplugin_version = '0.6.16'
+let g:lua_ftplugin_version = '0.6.17'
" Commands to manually check for syntax errors and undefined globals.
command! -bar LuaCheckSyntax call xolox#lua#checksyntax()
Please sign in to comment.
Something went wrong with that request. Please try again.