Skip to content

Commit 378dd12

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

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

autoload/xolox/notes.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load 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/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.23.1'
9+
let g:xolox#notes#version = '0.23.2'
1010
let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
1111
let s:scriptdir = expand('<sfile>:p:h')
1212

plugin/notes.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: June 23, 2013
3+
" Last Change: August 19, 2013
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Support for automatic update using the GLVS plug-in.
@@ -11,6 +11,19 @@ if &cp || exists('g:loaded_notes')
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-notes 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-notes plug-in will now be disabled."
23+
let g:loaded_notes = 1
24+
finish
25+
endtry
26+
1427
" Initialize the configuration defaults.
1528
call xolox#notes#init()
1629

0 commit comments

Comments
 (0)