Skip to content

Commit

Permalink
Use if-lua by default (because of if-lua-corelibs.diff)
Browse files Browse the repository at this point in the history
Thanks Luis Carvalho! :-)
  • Loading branch information
xolox committed Aug 7, 2010
1 parent 33f55f1 commit 7bec1f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -16,7 +16,7 @@ When you open any Lua file the semantic highlighting should be enabled automatic

### The `:LuaInspect` command

You shouldn't need to execute this command manually unless you've disabled automatic highlighting using the `g:lua_inspect_events` option. When you execute the `:LuaInspect` command the plug-in runs the LuaInspect tool and then highlights all variables in the current buffer using one of the following highlighting groups:
You don't need to use this command unless you've disabled automatic highlighting using `g:lua_inspect_events`. When you execute this command the plug-in runs the LuaInspect tool and then highlights all variables in the current buffer using one of the following highlighting groups:

* <span style="color: #600000">luaInspectGlobalDefined</span>
* <span style="color: #FFF; background: #F00">luaInspectGlobalUndefined</span>
Expand Down Expand Up @@ -45,9 +45,9 @@ Note that this only works when the plug-in is loaded (or reloaded) *after* setti

### The `g:lua_inspect_internal` option

The plug-in can use the Lua interface for Vim so it doesn't have to run LuaInspect as an external program (which can slow things down). This feature isn't enabled by default though, because the Lua interface for Vim doesn't include most of `io.*` and `os.*` from Lua's standard library, and this causes LuaInspect to flag all references to those modules as undefined global variables! If you want to enable use of the Lua interface for Vim despite this, you can add the following to your [vimrc script](http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc):
The plug-in uses the Lua interface for Vim when available so that it doesn't have to run LuaInspect as an external program (which can slow things down). If you insist on running LuaInspect as an external program you can set this variable to false (0) in your [vimrc script](http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc):

:let g:lua_inspect_internal = 1
:let g:lua_inspect_internal = 0

## Not yet implemented

Expand Down
14 changes: 8 additions & 6 deletions luainspect.vim
Expand Up @@ -2,7 +2,7 @@
" Author: Peter Odding <peter@peterodding.com>
" Last Change: August 7, 2010
" URL: http://peterodding.com/code/vim/lua-inspect/
" Version: 0.1.8
" Version: 0.1.9
" License: MIT

" Don't source the plug-in when its already been loaded or &compatible is set.
Expand All @@ -18,11 +18,13 @@ if !exists('g:lua_inspect_events')
endif

if !exists('g:lua_inspect_internal')
" Set this to false (0) to run LuaInspect inside the Lua interface for Vim.
" This makes it faster but less accurate because the Lua interface for Vim
" doesn't include io.* and half of os.* which means LuaInspect marks them as
" undefined globals...
let g:lua_inspect_internal = 0
" Set this to false (0) to run LuaInspect as an external process instead of
" using the Lua interface for Vim. This makes it slower but might make it
" more accurate because the Lua interface for Vim didn't include io.* and
" os.* before the patch posted on 2010-07-28 which means LuaInspect would
" mark them as undefined globals. The patch I'm referring to is:
" http://groups.google.com/group/vim_dev/browse_frm/thread/9b77afa2fe4336c8
let g:lua_inspect_internal = has('lua')
endif

" The highlight groups and default styles/links defined by this plug-in.
Expand Down

0 comments on commit 7bec1f4

Please sign in to comment.