vim-jedi plays know correctly with the jumplist

This commit is contained in:
David Halter
2012-07-28 16:07:35 +02:00
parent eb7f141fe8
commit 752029071d

View File

@@ -93,6 +93,11 @@ if 1:
if not definitions: if not definitions:
echo_highlight("Couldn't find any definitions for this.") echo_highlight("Couldn't find any definitions for this.")
elif len(definitions) == 1: elif len(definitions) == 1:
# just add some mark to add the current position to the jumplist.
# this is ugly, because it overrides the mark for '`', so if anyone
# has a better idea, let me know.
vim.command('normal! m`')
d = definitions[0] d = definitions[0]
if d.module_path != vim.current.buffer.name: if d.module_path != vim.current.buffer.name:
vim.command('edit ' + d.module_path) vim.command('edit ' + d.module_path)
@@ -113,7 +118,7 @@ endfunction
" Initialization of jedi-vim " Initialization of jedi-vim
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" default for jedi-vim " defaults for jedi-vim
let g:jedi#use_tabs_not_buffers = 0 let g:jedi#use_tabs_not_buffers = 0
let s:current_file=expand("<sfile>") let s:current_file=expand("<sfile>")