Permalink
Browse files

Make sure vim-misc is installed, politely complain if it isn't

  • Loading branch information...
1 parent c79c8d9 commit d7fb876f0291cbd13c4c38177ada015fafc58770 @xolox committed Aug 19, 2013
Showing with 17 additions and 4 deletions.
  1. +2 −2 autoload/xolox/luainspect.vim
  2. +1 −1 doc/luainspect.txt
  3. +14 −1 plugin/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)
View
@@ -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
View
@@ -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.
@@ -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

0 comments on commit d7fb876

Please sign in to comment.