Skip to content

Commit d7fb876

Browse files
committed
Make sure vim-misc is installed, politely complain if it isn't
1 parent c79c8d9 commit d7fb876

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

autoload/xolox/luainspect.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim script.
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: July 18, 2013
3+
" Last Change: August 19, 2013
44
" URL: http://peterodding.com/code/vim/lua-inspect/
55

6-
let g:xolox#luainspect#version = '0.5'
6+
let g:xolox#luainspect#version = '0.5.1'
77

88
function! xolox#luainspect#toggle_cmd() " {{{1
99
if !(exists('b:luainspect_disabled') && b:luainspect_disabled)

doc/luainspect.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ lua-inspect. If you like this plug-in please vote for it on Vim Online [14].
188188
*luainspect-license*
189189
License ~
190190

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

194194
The source code repository and distributions contain bundled copies of

plugin/luainspect.vim

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim plug-in
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: November 15, 2011
3+
" Last Change: August 19, 2013
44
" URL: http://peterodding.com/code/vim/lua-inspect/
55

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

14+
" Make sure vim-misc is installed.
15+
try
16+
" The point of this code is to do something completely innocent while making
17+
" sure the vim-misc plug-in is installed. We specifically don't use Vim's
18+
" exists() function because it doesn't load auto-load scripts that haven't
19+
" already been loaded yet (last tested on Vim 7.3).
20+
call type(g:xolox#misc#version)
21+
catch
22+
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."
23+
let g:loaded_luainspect = 1
24+
finish
25+
endtry
26+
1427
if !exists('g:lua_inspect_warnings')
1528
" Change this to disable automatic warning messages.
1629
let g:lua_inspect_warnings = 1

0 commit comments

Comments
 (0)