mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 03:24:47 +08:00
removed get_definition in vim plugin
This commit is contained in:
13
jedi.vim
13
jedi.vim
@@ -11,7 +11,7 @@ if !has('python')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" Completion
|
" completion
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
|
|
||||||
function! jedi#Complete(findstart, base)
|
function! jedi#Complete(findstart, base)
|
||||||
@@ -69,17 +69,17 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" get_definition
|
" goto
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
"
|
|
||||||
function! jedi#show_definition()
|
function! jedi#goto()
|
||||||
python << PYTHONEOF
|
python << PYTHONEOF
|
||||||
if 1:
|
if 1:
|
||||||
row, column = vim.current.window.cursor
|
row, column = vim.current.window.cursor
|
||||||
buf_path = vim.current.buffer.name
|
buf_path = vim.current.buffer.name
|
||||||
source = '\n'.join(vim.current.buffer)
|
source = '\n'.join(vim.current.buffer)
|
||||||
try:
|
try:
|
||||||
definitions = functions.get_definitions(source, row, column, buf_path)
|
definitions = functions.goto(source, row, column, buf_path)
|
||||||
except functions.NotFoundError:
|
except functions.NotFoundError:
|
||||||
msg = 'There is no useful expression under the cursor'
|
msg = 'There is no useful expression under the cursor'
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -100,6 +100,9 @@ endfunction
|
|||||||
" Initialization of Jedi
|
" Initialization of Jedi
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
" defaults for jedi
|
||||||
|
let g:use_tabs_not_buffers = 0
|
||||||
|
|
||||||
let s:current_file=expand("<sfile>")
|
let s:current_file=expand("<sfile>")
|
||||||
|
|
||||||
python << PYTHONEOF
|
python << PYTHONEOF
|
||||||
|
|||||||
Reference in New Issue
Block a user