set the cursor to the right position, messed that up in the previous commit, #65

This commit is contained in:
David Halter
2013-01-14 16:15:06 +01:00
parent 69e4cead81
commit 2b0e66b565

View File

@@ -268,14 +268,15 @@ def rename():
vim.command('normal! diw')
vim.command(':startinsert')
else:
cursor = vim.current.window.cursor
window_path = vim.current.buffer.name
# reset autocommand
vim.command('autocmd! jedi_rename InsertLeave')
replace = vim.eval("expand('<cword>')")
vim.command('normal! u') # undo new word
vim.command('normal! u') # 2u didn't work...
cursor = vim.current.window.cursor
vim.command('normal! u') # undo the space at the end
vim.current.window.cursor = cursor
if replace is None:
echo_highlight('No rename possible, if no name is given.')