mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 03:24:47 +08:00
set the cursor to the right position, messed that up in the previous commit, #65
This commit is contained in:
@@ -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.')
|
||||
|
||||
Reference in New Issue
Block a user