From 79cc4f633076dea39427b06563e0b9c6e98a49b5 Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 11 Sep 2012 10:10:09 +0200 Subject: [PATCH] add param for rename function to switch each case as discussed in #7 --- jedi.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jedi.vim b/jedi.vim index f5fdf81..c807bb7 100644 --- a/jedi.vim +++ b/jedi.vim @@ -95,10 +95,11 @@ endfunction " ------------------------------------------------------------------------ " rename " ------------------------------------------------------------------------ -function! jedi#rename() +function! jedi#rename(start_renaming) python << PYTHONEOF if 1: - if temp_rename is None: + start_renaming = int(vim.eval('a:start_renaming')) + if start_renaming == 0: temp_rename = _goto(is_related_name=True, no_output=True) _rename_cursor = vim.current.window.cursor @@ -106,7 +107,7 @@ if 1: vim.current.window.cursor = _rename_cursor vim.command('augroup jedi_rename') - vim.command('autocmd InsertLeave * call jedi#rename()') + vim.command('autocmd InsertLeave * call jedi#rename(1)') vim.command('augroup END') vim.command('normal! diw') @@ -331,7 +332,7 @@ if g:jedi#auto_initialization autocmd FileType python execute "noremap ".g:jedi#get_definition_command." :call jedi#get_definition()" autocmd FileType python execute "noremap ".g:jedi#related_names_command." :call jedi#related_names()" " rename - autocmd FileType python execute "noremap ".g:jedi#rename_command." :call jedi#rename()" + autocmd FileType python execute "noremap ".g:jedi#rename_command." :call jedi#rename(0)" " pydoc autocmd FileType python execute "nnoremap ".g:jedi#pydoc." :call jedi#show_pydoc()" end