From 4b01e7a4c7a79beee4fc33791917957ca942a551 Mon Sep 17 00:00:00 2001 From: claytron Date: Tue, 19 Oct 2010 14:35:07 -0400 Subject: [PATCH] Emit a warning when there is no Python support, or unsupported Python version --- plugin/gundo.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugin/gundo.vim b/plugin/gundo.vim index c6a7c37..9b21af0 100644 --- a/plugin/gundo.vim +++ b/plugin/gundo.vim @@ -16,6 +16,28 @@ "let loaded_gundo = 1 +let s:warning_string = "Gundo requires that vim be compiled with Python 2.5+" +" Check for Python support and required version +if has('python') + let s:has_supported_python = 1 +python << ENDPYTHON +import sys +import vim +if sys.version_info[:2] < (2, 5): + vim.command('let s:has_supported_python = 0') +ENDPYTHON + + " Python version is too old + if !s:has_supported_python + echo s:warning_string + finish + endif +else + " no Python support + echo s:warning_string + finish +endif + if !exists('g:gundo_width') let g:gundo_width = 45 endif