mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-09 20:15:01 +08:00
Fix issues with wildignore and tag stack
Closes https://github.com/davidhalter/jedi-vim/pull/483. Fixes https://github.com/davidhalter/jedi-vim/issues/482.
This commit is contained in:
committed by
Daniel Hahler
parent
a5be01fb0b
commit
4b32847110
10
jedi_vim.py
10
jedi_vim.py
@@ -248,22 +248,28 @@ def goto(mode="goto", no_output=False):
|
||||
echo_highlight("Builtin modules cannot be displayed (%s)."
|
||||
% d.desc_with_module)
|
||||
else:
|
||||
using_tagstack = vim_eval('g:jedi#use_tag_stack') == '1'
|
||||
if d.module_path != vim.current.buffer.name:
|
||||
result = new_buffer(d.module_path, using_tagstack=True)
|
||||
result = new_buffer(d.module_path,
|
||||
using_tagstack=using_tagstack)
|
||||
if not result:
|
||||
return []
|
||||
if d.module_path and vim_eval('g:jedi#use_tag_stack') == '1':
|
||||
if d.module_path and using_tagstack:
|
||||
with NamedTemporaryFile('w', prefix=vim_eval('tempname()')) as f:
|
||||
tagname = d.name
|
||||
f.write('{0}\t{1}\t{2}'.format(tagname, d.module_path,
|
||||
'call cursor({0}, {1})'.format(d.line, d.column + 1)))
|
||||
f.flush()
|
||||
old_tags = vim.eval('&tags')
|
||||
old_wildignore = vim.eval('&wildignore')
|
||||
try:
|
||||
# Clear wildignore to ensure tag file isn't ignored
|
||||
vim.command('set wildignore=')
|
||||
vim.command('set tags=%s' % f.name)
|
||||
vim.command('tjump %s' % tagname)
|
||||
finally:
|
||||
vim.command('set tags=%s' % old_tags)
|
||||
vim.command('let &wildignore = "%s"' % old_wildignore)
|
||||
vim.current.window.cursor = d.line, d.column
|
||||
else:
|
||||
# multiple solutions
|
||||
|
||||
Reference in New Issue
Block a user