From 2b0e66b565dc4d809ec805a8041234fc01b8a47a Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 14 Jan 2013 16:15:06 +0100 Subject: [PATCH] set the cursor to the right position, messed that up in the previous commit, #65 --- plugin/jedi_vim.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index a4a60a7..1402d0b 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -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('')") 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.')