From 0f1bc5ddceb50ca8f96d91aabf8157d9758af0cd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 12 Feb 2018 04:19:03 +0100 Subject: test/python: less-noisy Python skip-message Developer can use :checkhealth to get more details, don't need to blast the details in the skip-message every time. --- test/functional/provider/python3_spec.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test/functional/provider/python3_spec.lua') diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua index aa50f53451..f06728ec0e 100644 --- a/test/functional/provider/python3_spec.lua +++ b/test/functional/provider/python3_spec.lua @@ -7,11 +7,8 @@ local missing_provider = helpers.missing_provider do clear() - local err = missing_provider('python3') - if err then - pending( - 'Python 3 (or the Python 3 neovim module) is broken or missing:\n' .. err, - function() end) + if missing_provider('python3') then + pending('Python 3 (or the neovim module) is broken/missing', function() end) return end end -- cgit From 189c5abeba4fb508d879ebbf5fa07965c4092cf2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 20 Mar 2018 23:57:41 +0100 Subject: provider/RPC: apply_autocmds_group(): fix double-free During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ --- test/functional/provider/python3_spec.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'test/functional/provider/python3_spec.lua') diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua index f06728ec0e..93ac3ae017 100644 --- a/test/functional/provider/python3_spec.lua +++ b/test/functional/provider/python3_spec.lua @@ -3,6 +3,7 @@ local eval, command, feed = helpers.eval, helpers.command, helpers.feed local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert local expect, write_file = helpers.expect, helpers.write_file local feed_command = helpers.feed_command +local source = helpers.source local missing_provider = helpers.missing_provider do @@ -13,7 +14,7 @@ do end end -describe('python3 commands and functions', function() +describe('python3 provider', function() before_each(function() clear() command('python3 import vim') @@ -82,4 +83,20 @@ describe('python3 commands and functions', function() it('py3eval', function() eq({1, 2, {['key'] = 'val'}}, eval([[py3eval('[1, 2, {"key": "val"}]')]])) end) + + it('RPC call to expand("") during BufDelete #5245 #5617', function() + source([=[ + python3 << EOF + import vim + def foo(): + vim.eval('expand(":p")') + vim.eval('bufnr(expand(":p"))') + EOF + autocmd BufDelete * python3 foo() + autocmd BufUnload * python3 foo()]=]) + feed_command("exe 'split' tempname()") + feed_command("bwipeout!") + feed_command('help help') + eq(2, eval('1+1')) -- Still alive? + end) end) -- cgit