forked from aniani/vim
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)
This commit is contained in:
committed by
Bram Moolenaar
parent
34d1773bd4
commit
61021aa318
@@ -2005,6 +2005,8 @@ v:completed_item
|
|||||||
|Dictionary| containing the |complete-items| for the most
|
|Dictionary| containing the |complete-items| for the most
|
||||||
recently completed word after |CompleteDone|. The
|
recently completed word after |CompleteDone|. The
|
||||||
|Dictionary| is empty if the completion failed.
|
|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* *count-variable*
|
||||||
v:count The count given for the last Normal mode command. Can be used
|
v:count The count given for the last Normal mode command. Can be used
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static struct vimvar
|
|||||||
{VV_NAME("oldfiles", VAR_LIST), &t_list_string, 0},
|
{VV_NAME("oldfiles", VAR_LIST), &t_list_string, 0},
|
||||||
{VV_NAME("windowid", VAR_NUMBER), NULL, VV_RO},
|
{VV_NAME("windowid", VAR_NUMBER), NULL, VV_RO},
|
||||||
{VV_NAME("progpath", VAR_STRING), 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_new", VAR_STRING), NULL, VV_RO},
|
||||||
{VV_NAME("option_old", VAR_STRING), NULL, VV_RO},
|
{VV_NAME("option_old", VAR_STRING), NULL, VV_RO},
|
||||||
{VV_NAME("option_oldlocal", VAR_STRING), NULL, VV_RO},
|
{VV_NAME("option_oldlocal", VAR_STRING), NULL, VV_RO},
|
||||||
|
|||||||
@@ -387,6 +387,19 @@ func Test_CompleteDone_undo()
|
|||||||
au! CompleteDone
|
au! CompleteDone
|
||||||
endfunc
|
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)
|
func CompleteTest(findstart, query)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
return col('.')
|
return col('.')
|
||||||
|
|||||||
@@ -735,6 +735,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
92,
|
||||||
/**/
|
/**/
|
||||||
91,
|
91,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user