The error shows up on :Gundo and looks like this:
Error detected while processing function gundo#GundoShow[1]..<SNR>116_GundoShow[4]..<SNR>116_GundoOpen[31]..<SNR>116_GundoRenderPreview:
line 2:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 474, in GundoRenderPreview
_output_preview_text(_generate_preview_diff(current, node_before, node_after))
File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 382, in _generate_preview_diff
before_time, after_time))
File "/usr/lib/python3.5/difflib.py", line 1177, in unified_diff
_check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
File "/usr/lib/python3.5/difflib.py", line 1312, in _check_types
raise TypeError('all arguments must be str, not: %r' % (arg,))
TypeError: all arguments must be str, not: 46
The result of `difflib.unified_diff()` may contains newlines at the end of its
each line. It's suppressed in original Vim, but it's illegal in Neovim.
Since there is no good way to prevent `difflib` from appending newlines to the
results, `_output_preview_text()` function should sanitize it.
Thanks @michamos
Reference:
a5edc5f257/src/nvim/api/buffer.c (L215)https://github.com/sjl/gundo.vim/pull/30#issuecomment-170064637
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
Instead of displaying hardcoded "j/k" for motion between undo states,
real keymaps are fetched from `g:gundo_map_move_older` and
`g:undo_map_move_never` variables.
I want to use a custom statusline for both Gundo splits so i added two
variables for it setting it. If the variables are empty Gundo works like
normal but if there is something in them the text get used. Example:
let g:gundo_preview_statusline = "Gundo Preview"
let g:gundo_tree_statusline = "Gundo Tree"
The indentation was off in a few places so i fixed it. The real tabs was
removed and replaced with spaces like the rest of the source file.
The recent change that introduced python3 support also made it the default
python version used for Gundo. This caused a problem with certain versions of
vim where upon toggling the Gundo window, we would be greeted with an error
message: "This Vim cannot execute :py3 after using :python"
This commit adds a g:gundo_prefer_python3 variable (default 0) that can be used
to set a preference for python3. By default, python2 will be used.
This also required moving the variable initialization code to the top, since
just evaluating `has('python3')` seems to trigger the vim error.