Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure vim-misc is installed, politely complain if it isn't
  • Loading branch information
xolox committed Aug 19, 2013
1 parent c79c8d9 commit d7fb876
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions autoload/xolox/luainspect.vim
@@ -1,9 +1,9 @@
" Vim script.
" Author: Peter Odding <peter@peterodding.com>
" Last Change: July 18, 2013
" Last Change: August 19, 2013
" URL: http://peterodding.com/code/vim/lua-inspect/

let g:xolox#luainspect#version = '0.5'
let g:xolox#luainspect#version = '0.5.1'

function! xolox#luainspect#toggle_cmd() " {{{1
if !(exists('b:luainspect_disabled') && b:luainspect_disabled)
Expand Down
2 changes: 1 addition & 1 deletion doc/luainspect.txt
Expand Up @@ -188,7 +188,7 @@ lua-inspect. If you like this plug-in please vote for it on Vim Online [14].
*luainspect-license*
License ~

This software is licensed under the MIT license [15]. © 2013 Peter Odding
This software is licensed under the MIT license [15]. Š 2013 Peter Odding
<peter@peterodding.com>.

The source code repository and distributions contain bundled copies of
Expand Down
15 changes: 14 additions & 1 deletion plugin/luainspect.vim
@@ -1,6 +1,6 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
" Last Change: November 15, 2011
" Last Change: August 19, 2013
" URL: http://peterodding.com/code/vim/lua-inspect/

" Support for automatic update using the GLVS plug-in.
Expand All @@ -11,6 +11,19 @@ if &cp || exists('g:loaded_luainspect')
finish
endif

" Make sure vim-misc is installed.
try
" The point of this code is to do something completely innocent while making
" sure the vim-misc plug-in is installed. We specifically don't use Vim's
" exists() function because it doesn't load auto-load scripts that haven't
" already been loaded yet (last tested on Vim 7.3).
call type(g:xolox#misc#version)
catch
echomsg "Warning: The vim-lua-inspect plug-in requires the vim-misc plug-in which seems not to be installed! For more information please review the installation instructions in the readme (also available on the homepage and on GitHub). The vim-lua-inspect plug-in will now be disabled."
let g:loaded_luainspect = 1
finish
endtry

if !exists('g:lua_inspect_warnings')
" Change this to disable automatic warning messages.
let g:lua_inspect_warnings = 1
Expand Down

0 comments on commit d7fb876

Please sign in to comment.