Skip to content

Commit

Permalink
Completion bug fix: Off by one in prefix selection
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 18, 2011
1 parent 5d0ad12 commit 865c32f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions autoload/xolox/lua.vim
Expand Up @@ -288,7 +288,7 @@ endif


function! xolox#lua#completefunc(init, base) " {{{1 function! xolox#lua#completefunc(init, base) " {{{1
if a:init if a:init
return s:get_completion_prefix() return s:getcompletionprefix()
endif endif
let items = [] let items = []
if xolox#lua#getopt('lua_complete_keywords', 1) if xolox#lua#getopt('lua_complete_keywords', 1)
Expand All @@ -305,8 +305,8 @@ function! xolox#lua#completefunc(init, base) " {{{1
return s:addsignatures(items) return s:addsignatures(items)
endfunction endfunction


function! s:get_completion_prefix() function! s:getcompletionprefix()
return match(strpart(getline('.'), 0, col('.') - 2), '\w\+\.\?\w*$') return match(strpart(getline('.'), 0, col('.') - 1), '\w\+\.\?\w*$')
endfunction endfunction


function! s:addsignatures(entries) function! s:addsignatures(entries)
Expand All @@ -333,7 +333,7 @@ endfunction


function! xolox#lua#omnifunc(init, base) " {{{1 function! xolox#lua#omnifunc(init, base) " {{{1
if a:init if a:init
return s:get_completion_prefix() return s:getcompletionprefix()
elseif !xolox#lua#getopt('lua_complete_omni', 0) 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) throw printf("lua.vim %s: omni completion needs to be explicitly enabled, see the readme!", g:lua_ftplugin_version)
endif endif
Expand Down
2 changes: 1 addition & 1 deletion plugin/lua-ftplugin.vim
Expand Up @@ -12,7 +12,7 @@ if &cp || exists('g:loaded_lua_ftplugin')
finish finish
endif 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. " Commands to manually check for syntax errors and undefined globals.
command! -bar LuaCheckSyntax call xolox#lua#checksyntax() command! -bar LuaCheckSyntax call xolox#lua#checksyntax()
Expand Down

0 comments on commit 865c32f

Please sign in to comment.