discussed in issue #7

This commit is contained in:
David Halter
2012-09-12 01:10:52 +02:00
parent a5d9d4e189
commit ebc81a1952

View File

@@ -95,10 +95,13 @@ endfunction
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" rename " rename
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
function! jedi#rename(start_renaming) function! jedi#rename(...)
python << PYTHONEOF python << PYTHONEOF
if 1: if 1:
start_renaming = int(vim.eval('a:start_renaming')) try:
start_renaming = int(vim.eval('a:0'))
except vim.error:
start_renaming = 0
if start_renaming == 0: if start_renaming == 0:
temp_rename = _goto(is_related_name=True, no_output=True) temp_rename = _goto(is_related_name=True, no_output=True)
_rename_cursor = vim.current.window.cursor _rename_cursor = vim.current.window.cursor
@@ -209,8 +212,10 @@ function! jedi#new_buffer(path)
if g:jedi#use_tabs_not_buffers if g:jedi#use_tabs_not_buffers
return jedi#tabnew(a:path) return jedi#tabnew(a:path)
else else
if &modified if &hidden == 0
w if &modified
w
endif
endif endif
edit! a:path edit! a:path
endif endif
@@ -332,7 +337,7 @@ if g:jedi#auto_initialization
autocmd FileType python execute "noremap <buffer>".g:jedi#get_definition_command." :call jedi#get_definition()<CR>" autocmd FileType python execute "noremap <buffer>".g:jedi#get_definition_command." :call jedi#get_definition()<CR>"
autocmd FileType python execute "noremap <buffer>".g:jedi#related_names_command." :call jedi#related_names()<CR>" autocmd FileType python execute "noremap <buffer>".g:jedi#related_names_command." :call jedi#related_names()<CR>"
" rename " rename
autocmd FileType python execute "noremap <buffer>".g:jedi#rename_command." :call jedi#rename(0)<CR>" autocmd FileType python execute "noremap <buffer>".g:jedi#rename_command." :call jedi#rename()<CR>"
" pydoc " pydoc
autocmd FileType python execute "nnoremap <silent> <buffer>".g:jedi#pydoc." :call jedi#show_pydoc()<CR>" autocmd FileType python execute "nnoremap <silent> <buffer>".g:jedi#pydoc." :call jedi#show_pydoc()<CR>"
end end