Skip to content

Commit 865c32f

Browse files
committed
Completion bug fix: Off by one in prefix selection
1 parent 5d0ad12 commit 865c32f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎autoload/xolox/lua.vim‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ endif
288288

289289
function! xolox#lua#completefunc(init, base) " {{{1
290290
if a:init
291-
return s:get_completion_prefix()
291+
return s:getcompletionprefix()
292292
endif
293293
let items = []
294294
if xolox#lua#getopt('lua_complete_keywords', 1)
@@ -305,8 +305,8 @@ function! xolox#lua#completefunc(init, base) " {{{1
305305
return s:addsignatures(items)
306306
endfunction
307307

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*$')
310310
endfunction
311311

312312
function! s:addsignatures(entries)
@@ -333,7 +333,7 @@ endfunction
333333

334334
function! xolox#lua#omnifunc(init, base) " {{{1
335335
if a:init
336-
return s:get_completion_prefix()
336+
return s:getcompletionprefix()
337337
elseif !xolox#lua#getopt('lua_complete_omni', 0)
338338
throw printf("lua.vim %s: omni completion needs to be explicitly enabled, see the readme!", g:lua_ftplugin_version)
339339
endif

‎plugin/lua-ftplugin.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if &cp || exists('g:loaded_lua_ftplugin')
1212
finish
1313
endif
1414

15-
let g:lua_ftplugin_version = '0.6.16'
15+
let g:lua_ftplugin_version = '0.6.17'
1616

1717
" Commands to manually check for syntax errors and undefined globals.
1818
command! -bar LuaCheckSyntax call xolox#lua#checksyntax()

0 commit comments

Comments
 (0)