patch 9.0.0092: plugins cannot change v:completed_item
Problem: Plugins cannot change v:completed_item.
Solution: Make v:completed_item writeable. (Shougo Matsushita,
closes #10801)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 290f03f..3dfacf7 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2005,6 +2005,8 @@
|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
diff --git a/src/evalvars.c b/src/evalvars.c
index 7e6bf7a..16dfd0d 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -111,7 +111,7 @@
{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("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},
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index 7bebc5d..35c5785 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -387,6 +387,19 @@
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('.')
diff --git a/src/version.c b/src/version.c
index 5adb215..4d97dcd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 92,
+/**/
91,
/**/
90,