From b514374da8475de151a8d85795263682ecf2585b Mon Sep 17 00:00:00 2001 From: David Fisher Date: Wed, 27 Aug 2014 13:13:45 -0700 Subject: [PATCH 1/2] Fix pyfile call for paths with spaces --- autoload/gundo.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/gundo.vim b/autoload/gundo.vim index 970413d..ce7ad11 100644 --- a/autoload/gundo.vim +++ b/autoload/gundo.vim @@ -280,10 +280,10 @@ endfunction"}}} function! s:GundoOpen()"{{{ if !exists('g:gundo_py_loaded') if s:has_supported_python == 2 && g:gundo_prefer_python3 - exe 'py3file ' . s:plugin_path . '/gundo.py' + exe 'py3file ' . escape(s:plugin_path, ' ') . '/gundo.py' python3 initPythonModule() else - exe 'pyfile ' . s:plugin_path . '/gundo.py' + exe 'pyfile ' . escape(s:plugin_path, ' ') . '/gundo.py' python initPythonModule() endif From d8ea993adcf5b463d74af043e78f8ebe3bd86446 Mon Sep 17 00:00:00 2001 From: Omar Khan Date: Wed, 7 Oct 2015 10:34:15 +0700 Subject: [PATCH 2/2] Send strings to difflib.unified_diff Python 3.5 adds type-checking to difflib, which causes gundo to fail. This fixes the issue by converting the arguments to strings. See https://bugs.python.org/issue17445 for details --- autoload/gundo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/gundo.py b/autoload/gundo.py index e80dcda..2a4b130 100644 --- a/autoload/gundo.py +++ b/autoload/gundo.py @@ -361,7 +361,7 @@ def _generate_preview_diff(current, node_before, node_after): before_name = 'Original' before_time = '' - after_name = node_after.n + after_name = str(node_after.n) after_time = _fmt_time(node_after.time) else: _undo_to(node_before.n) @@ -370,9 +370,9 @@ def _generate_preview_diff(current, node_before, node_after): _undo_to(node_after.n) after_lines = vim.current.buffer[:] - before_name = node_before.n + before_name = str(node_before.n) before_time = _fmt_time(node_before.time) - after_name = node_after.n + after_name = str(node_after.n) after_time = _fmt_time(node_after.time) _undo_to(current) @@ -390,9 +390,9 @@ def _generate_change_preview_diff(current, node_before, node_after): _undo_to(node_after.n) after_lines = vim.current.buffer[:] - before_name = node_before.n or 'Original' + before_name = str(node_before.n or 'Original') before_time = node_before.time and _fmt_time(node_before.time) or '' - after_name = node_after.n or 'Original' + after_name = str(node_after.n or 'Original') after_time = node_after.time and _fmt_time(node_after.time) or '' _undo_to(current)