# HG changeset patch # User claytron # Date 1287513307 14400 # Node ID 29bbe78a79df8177ca1b07863fb0a5c4a519a1d5 # Parent 40049e1b235d68d8d4e35d3f21bab89fd39fbc1a Emit a warning when there is no Python support, or unsupported Python version diff -r 40049e1b235d -r 29bbe78a79df plugin/gundo.vim --- a/plugin/gundo.vim Mon Oct 18 16:21:51 2010 -0400 +++ b/plugin/gundo.vim Tue Oct 19 14:35:07 2010 -0400 @@ -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