To: vim_dev@googlegroups.com Subject: Patch 9.0.0092 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0092 Problem: Plugins cannot change v:completed_item. Solution: Make v:completed_item writeable. (Shougo Matsushita, closes #10801) Files: runtime/doc/eval.txt, src/evalvars.c, src/testdir/test_ins_complete.vim *** ../vim-9.0.0091/runtime/doc/eval.txt 2022-06-28 11:21:05.000000000 +0100 --- runtime/doc/eval.txt 2022-07-27 14:39:14.644649423 +0100 *************** *** 2005,2010 **** --- 2005,2012 ---- |Dictionary| containing the |complete-items| for the most recently completed word after |CompleteDone|. The |Dictionary| is empty if the completion failed. + Note: Plugins can modify the value to emulate the builtin + |CompleteDone| event behavior. *v:count* *count-variable* v:count The count given for the last Normal mode command. Can be used *** ../vim-9.0.0091/src/evalvars.c 2022-07-27 12:30:08.405165929 +0100 --- src/evalvars.c 2022-07-27 14:35:33.625150594 +0100 *************** *** 111,117 **** {VV_NAME("oldfiles", VAR_LIST), &t_list_string, 0}, {VV_NAME("windowid", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("progpath", VAR_STRING), NULL, VV_RO}, ! {VV_NAME("completed_item", VAR_DICT), &t_dict_string, VV_RO}, {VV_NAME("option_new", VAR_STRING), NULL, VV_RO}, {VV_NAME("option_old", VAR_STRING), NULL, VV_RO}, {VV_NAME("option_oldlocal", VAR_STRING), NULL, VV_RO}, --- 111,117 ---- {VV_NAME("oldfiles", VAR_LIST), &t_list_string, 0}, {VV_NAME("windowid", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("progpath", VAR_STRING), NULL, VV_RO}, ! {VV_NAME("completed_item", VAR_DICT), &t_dict_string, 0}, {VV_NAME("option_new", VAR_STRING), NULL, VV_RO}, {VV_NAME("option_old", VAR_STRING), NULL, VV_RO}, {VV_NAME("option_oldlocal", VAR_STRING), NULL, VV_RO}, *** ../vim-9.0.0091/src/testdir/test_ins_complete.vim 2022-07-23 06:53:01.097648234 +0100 --- src/testdir/test_ins_complete.vim 2022-07-27 14:35:33.625150594 +0100 *************** *** 387,392 **** --- 387,405 ---- au! CompleteDone endfunc + func Test_CompleteDone_modify() + let value = { + \ 'word': '', + \ 'abbr': '', + \ 'menu': '', + \ 'info': '', + \ 'kind': '', + \ 'user_data': '', + \ } + let v:completed_item = value + call assert_equal(v:completed_item, value) + endfunc + func CompleteTest(findstart, query) if a:findstart return col('.') *** ../vim-9.0.0091/src/version.c 2022-07-27 13:18:10.127091809 +0100 --- src/version.c 2022-07-27 14:36:59.720959938 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 92, /**/ -- hundred-and-one symptoms of being an internet addict: 150. You find yourself counting emoticons to get to sleep. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///