Skip to content

Commit

Permalink
Make sure vim-misc is installed, politely complain if it isn't
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Aug 19, 2013
1 parent 1fe9135 commit 378dd12
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions autoload/xolox/notes.vim
@@ -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')

Expand Down
15 changes: 14 additions & 1 deletion plugin/notes.vim
@@ -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.
Expand All @@ -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()

Expand Down

0 comments on commit 378dd12

Please sign in to comment.