diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-05-31 21:00:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-31 13:00:32 +0000 |
| commit | 3f4a108cf46f7de17d65949f86e629e584cd310a (patch) | |
| tree | 14686ab03cca24336a1863d395c1c4fd91167c2c /runtime/syntax/cpp.vim | |
| parent | f8a56a8439857da0c4c231d5f5058eebac3f360f (diff) | |
| download | rneovim-3f4a108cf46f7de17d65949f86e629e584cd310a.tar.gz rneovim-3f4a108cf46f7de17d65949f86e629e584cd310a.tar.bz2 rneovim-3f4a108cf46f7de17d65949f86e629e584cd310a.zip | |
vim-patch:9.2.0568: pythoncomplete: g:pythoncomplete_allow_import had no effect (#40067)
Problem: The security patch 9.2.0561 added a vim.eval() call inside
Completer.evalsource() to honor g:pythoncomplete_allow_import.
But the 'vim' module is only imported inside the outer
vimcomplete() / vimpy3complete() function, not at the script's
top level, so referring to it from a Completer method raises
NameError. The surrounding bare 'except' silently swallows
the error and leaves allow_imports at 0, meaning the opt-in
never takes effect -- 'import os' (and any other
buffer-level import) is always skipped, no candidates are
produced for 'os.<...>' and
Test_popup_and_preview_autocommand() fails on the Windows
CI matrix (Linux skips the test because Python 2 is absent).
Solution: Re-import 'vim' at the top of evalsource() in both
pythoncomplete.vim and python3complete.vim so the eval reads
the global, and set g:pythoncomplete_allow_import = 1 in the
test (it is the opt-in intended for callers that trust the
buffer contents) (thinca).
closes: vim/vim#20386
https://github.com/vim/vim/commit/868ad62cb8bf8038322eab2badd31bd98b02b9df
Co-authored-by: thinca <thinca@gmail.com>
Diffstat (limited to 'runtime/syntax/cpp.vim')
0 files changed, 0 insertions, 0 deletions