From 0844b14866beea3308d615a4d3206a836fee106f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=BAlio=20Costa?= Date: Fri, 17 Feb 2017 22:24:39 -0200 Subject: [PATCH] rename: use new Jedi interface Fixes https://github.com/davidhalter/jedi-vim/issues/671. Closes https://github.com/davidhalter/jedi-vim/pull/684. --- jedi_vim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi_vim.py b/jedi_vim.py index 56bcdd5..5ddd80a 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -567,7 +567,7 @@ def do_rename(replace, orig=None): # Sort the whole thing reverse (positions at the end of the line # must be first, because they move the stuff before the position). temp_rename = sorted(temp_rename, reverse=True, - key=lambda x: (x.module_path, x.start_pos)) + key=lambda x: (x.module_path, x.line, x.column)) buffers = set() for r in temp_rename: if r.in_builtin_module(): @@ -585,7 +585,7 @@ def do_rename(replace, orig=None): saved_view = vim_eval('string(winsaveview())') # Replace original word. - vim.current.window.cursor = r.start_pos + vim.current.window.cursor = (r.line, r.column) vim_command('normal! c{0:d}l{1}'.format(len(orig), replace)) # Restore view.