mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 10:54:22 +08:00
get_script: additional_dynamic_modules: add only listed buffers
Unlisted buffers might come e.g. from `set viminfo+=%`, and Jedi would crash on them. This could additionally check for them to be readable, but this should be handled in Jedi itself anyway.
This commit is contained in:
committed by
Dave Halter
parent
79b332a3c6
commit
1c3078e9f9
@@ -150,8 +150,11 @@ def _check_jedi_availability(show_error=False):
|
||||
|
||||
@catch_and_print_exceptions
|
||||
def get_script(source=None, column=None):
|
||||
jedi.settings.additional_dynamic_modules = \
|
||||
[b.name for b in vim.buffers if b.name is not None and b.name.endswith('.py')]
|
||||
jedi.settings.additional_dynamic_modules = [
|
||||
b.name for b in vim.buffers if (
|
||||
b.name is not None and
|
||||
b.name.endswith('.py') and
|
||||
b.options['buflisted'])]
|
||||
if source is None:
|
||||
source = '\n'.join(vim.current.buffer)
|
||||
row = vim.current.window.cursor[0]
|
||||
|
||||
Reference in New Issue
Block a user