Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Highlight syntax errors to make them stand out

  • Loading branch information...
commit 9e42b06b5db276d04689da751d88f001f69688b4 1 parent 79a5476
@xolox authored
Showing with 16 additions and 1 deletion.
  1. +15 −0 autoload/xolox/lua.vim
  2. +1 −1  ftplugin/lua.vim
View
15 autoload/xolox/lua.vim
@@ -79,6 +79,7 @@ function! xolox#lua#checksyntax() " {{{1
execute 'silent make! -p' shellescape(expand('%'))
cwindow
execute winnr . 'wincmd w'
+ call s:highlighterrors()
finally
let &makeprg = mp_save
let &errorformat = efm_save
@@ -87,6 +88,20 @@ function! xolox#lua#checksyntax() " {{{1
endif
endfunction
+function! s:highlighterrors()
+ let hlgroup = 'luaCompilerError'
+ if !hlexists(hlgroup)
+ execute 'highlight def link' hlgroup 'Error'
+ else
+ call clearmatches()
+ endif
+ let pattern = '^\%%%il.*\n\?'
+ for entry in getqflist()
+ call matchadd(hlgroup, '\%' . min([entry.lnum, line('$')]) . 'l')
+ call xolox#misc#msg#warn("%s: Syntax error on line %i: %s", s:script, entry.lnum, entry.text)
+ endfor
+endfunction
+
function! xolox#lua#help() " {{{1
" Get the expression under the cursor.
let cword = ''
View
2  ftplugin/lua.vim
@@ -3,7 +3,7 @@
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 14, 2011
" URL: http://peterodding.com/code/vim/lua-ftplugin
-" Version: 0.6.4
+" Version: 0.6.5
" Support for automatic update using the GLVS plug-in.
" GetLatestVimScripts: 3625 1 :AutoInstall: lua.zip
Please sign in to comment.
Something went wrong with that request. Please try again.