mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 11:34:51 +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('normal! diw')
|
||||||
vim.command(':startinsert')
|
vim.command(':startinsert')
|
||||||
else:
|
else:
|
||||||
cursor = vim.current.window.cursor
|
|
||||||
window_path = vim.current.buffer.name
|
window_path = vim.current.buffer.name
|
||||||
# reset autocommand
|
# reset autocommand
|
||||||
vim.command('autocmd! jedi_rename InsertLeave')
|
vim.command('autocmd! jedi_rename InsertLeave')
|
||||||
|
|
||||||
replace = vim.eval("expand('<cword>')")
|
replace = vim.eval("expand('<cword>')")
|
||||||
vim.command('normal! u') # undo new word
|
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:
|
if replace is None:
|
||||||
echo_highlight('No rename possible, if no name is given.')
|
echo_highlight('No rename possible, if no name is given.')
|
||||||
|
|||||||
Reference in New Issue
Block a user