Permalink
Browse files

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

  • Loading branch information...
1 parent 1fe9135 commit 378dd12664cecf3458f170aba0dbd83532781b27 @xolox committed Aug 19, 2013
Showing with 16 additions and 3 deletions.
  1. +2 −2 autoload/xolox/notes.vim
  2. +14 −1 plugin/notes.vim
View
@@ -1,12 +1,12 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: July 18, 2013
+" Last Change: August 19, 2013
" URL: http://peterodding.com/code/vim/notes/
" Note: This file is encoded in UTF-8 including a byte order mark so
" that Vim loads the script using the right encoding transparently.
-let g:xolox#notes#version = '0.23.1'
+let g:xolox#notes#version = '0.23.2'
let g:xolox#notes#url_pattern = '\<\(mailto:\|javascript:\|\w\{3,}://\)\(\S*\w\)\+/\?'
let s:scriptdir = expand('<sfile>:p:h')
View
@@ -1,6 +1,6 @@
" Vim plug-in
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: June 23, 2013
+" Last Change: August 19, 2013
" URL: http://peterodding.com/code/vim/notes/
" Support for automatic update using the GLVS plug-in.
@@ -11,6 +11,19 @@ if &cp || exists('g:loaded_notes')
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-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."
+ let g:loaded_notes = 1
+ finish
+endtry
+
" Initialize the configuration defaults.
call xolox#notes#init()

0 comments on commit 378dd12

Please sign in to comment.