Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug fix for dynamic completion after typing require('

(it shouldn't happen inside comments and strings)
  • Loading branch information...
commit 3e3d3dc3d6d0be922c88140fbee628511079f236 1 parent 5cf57e0
Peter Odding authored November 15, 2011

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. 10  autoload/xolox/lua.vim
10  autoload/xolox/lua.vim
... ...
@@ -1,9 +1,9 @@
1 1
 " Vim auto-load script
2 2
 " Author: Peter Odding <peter@peterodding.com>
3  
-" Last Change: October 23, 2011
  3
+" Last Change: November 15, 2011
4 4
 " URL: http://peterodding.com/code/vim/lua-ftplugin
5 5
 
6  
-let g:xolox#lua#version = '0.6.25'
  6
+let g:xolox#lua#version = '0.6.26'
7 7
 let s:miscdir = expand('<sfile>:p:h:h:h') . '/misc/lua-ftplugin'
8 8
 let s:omnicomplete_script = s:miscdir . '/omnicomplete.lua'
9 9
 let s:globals_script = s:miscdir . '/globals.lua'
@@ -410,12 +410,12 @@ function! xolox#lua#getomnivariables(modules) " {{{1
410 410
 endfunction
411 411
 
412 412
 function! xolox#lua#completedynamic(type) " {{{1
413  
-  if xolox#misc#option#get('lua_complete_dynamic', 1)
  413
+  if xolox#misc#option#get('lua_complete_dynamic', 1) && s:getsynid(1) !~? 'string\|comment\|keyword'
414 414
     if (a:type == "'" || a:type == '"') && xolox#misc#option#get('lua_complete_omni', 0)
415  
-      if strpart(getline('.'), 0, col('.') - 1) =~ 'require[^''"]*$'
  415
+      if strpart(getline('.'), 0, col('.') - 1) =~ 'require\s*(\?\s*$'
416 416
         return a:type . "\<C-x>\<C-o>"
417 417
       endif
418  
-    elseif a:type == '.' && s:getsynid(1) !~? 'string\|comment\|keyword'
  418
+    elseif a:type == '.'
419 419
       let column = col('.') - 1
420 420
       " Gotcha: even though '.' is remapped it counts as a column?
421 421
       if column && getline('.')[column - 1] =~ '\w'

0 notes on commit 3e3d3dc

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