rename: fix saving/restoring of the view

This seemed(?) to work with Python 3, but not for Python 2.  Just get a
string (instead of dict) from Vim, and re-use that as-is.

This fixes afb84a8.
This commit is contained in:
Daniel Hahler
2015-05-09 19:14:54 +02:00
parent 6025f59945
commit 9a13f143a8

View File

@@ -484,14 +484,14 @@ def do_rename(replace, orig = None):
buffers.add(vim.current.buffer.name)
# Save view.
saved_view = vim_eval('winsaveview()')
saved_view = vim_eval('string(winsaveview())')
# Replace original word.
vim.current.window.cursor = r.start_pos
vim_command('normal! c{:d}l{}'.format(len(orig), replace))
# Restore view.
vim_command('call winrestview(%s)' % PythonToVimStr(saved_view))
vim_command('call winrestview(%s)' % saved_view)
# Restore previous tab and window.
vim_command('tabnext {:d}'.format(saved_tab))