Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix for dynamic completion after typing require('

(it shouldn't happen inside comments and strings)
  • Loading branch information...
commit 3e3d3dc3d6d0be922c88140fbee628511079f236 1 parent 5cf57e0
@xolox authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 autoload/xolox/lua.vim
View
10 autoload/xolox/lua.vim
@@ -1,9 +1,9 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: October 23, 2011
+" Last Change: November 15, 2011
" URL: http://peterodding.com/code/vim/lua-ftplugin
-let g:xolox#lua#version = '0.6.25'
+let g:xolox#lua#version = '0.6.26'
let s:miscdir = expand('<sfile>:p:h:h:h') . '/misc/lua-ftplugin'
let s:omnicomplete_script = s:miscdir . '/omnicomplete.lua'
let s:globals_script = s:miscdir . '/globals.lua'
@@ -410,12 +410,12 @@ function! xolox#lua#getomnivariables(modules) " {{{1
endfunction
function! xolox#lua#completedynamic(type) " {{{1
- if xolox#misc#option#get('lua_complete_dynamic', 1)
+ if xolox#misc#option#get('lua_complete_dynamic', 1) && s:getsynid(1) !~? 'string\|comment\|keyword'
if (a:type == "'" || a:type == '"') && xolox#misc#option#get('lua_complete_omni', 0)
- if strpart(getline('.'), 0, col('.') - 1) =~ 'require[^''"]*$'
+ if strpart(getline('.'), 0, col('.') - 1) =~ 'require\s*(\?\s*$'
return a:type . "\<C-x>\<C-o>"
endif
- elseif a:type == '.' && s:getsynid(1) !~? 'string\|comment\|keyword'
+ elseif a:type == '.'
let column = col('.') - 1
" Gotcha: even though '.' is remapped it counts as a column?
if column && getline('.')[column - 1] =~ '\w'
Please sign in to comment.
Something went wrong with that request. Please try again.