aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt10
-rw-r--r--runtime/doc/news.txt3
-rw-r--r--runtime/doc/vvars.txt1
-rw-r--r--runtime/lua/vim/_meta/vvars.lua1
4 files changed, 15 insertions, 0 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index bb84966228..ca816851dd 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -466,6 +466,16 @@ CompleteDone After Insert mode completion is done. Either
CompleteDonePre if you need it.
|v:completed_item| gives the completed item.
+ Sets these |v:event| keys:
+ reason Reason for completion being
+ done. Can be one of:
+ - "accept": completion was
+ accepted using |complete_CTRL-Y|.
+ - "cancel": completion was cancelled
+ using |complete_CTRL-E|, pressing
+ a non-keyword character, or
+ triggering a new completion.
+
*CursorHold*
CursorHold When the user doesn't press a key for the time
specified with 'updatetime'. Not triggered
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index f8bc983441..03f6f7f8fd 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -130,6 +130,9 @@ UI
• TODO
+• |CompleteDone| now sets the `reason` key in `v:event` which specifies the reason
+ for completion being done.
+
==============================================================================
CHANGED FEATURES *news-changed*
diff --git a/runtime/doc/vvars.txt b/runtime/doc/vvars.txt
index de7f23a34d..15d836a83d 100644
--- a/runtime/doc/vvars.txt
+++ b/runtime/doc/vvars.txt
@@ -187,6 +187,7 @@ v:event
changed_window Is |v:true| if the event fired while
changing window (or tab) on |DirChanged|.
status Job status or exit code, -1 means "unknown". |TermClose|
+ reason Reason for completion being done. |CompleteDone|
*v:exception* *exception-variable*
v:exception
diff --git a/runtime/lua/vim/_meta/vvars.lua b/runtime/lua/vim/_meta/vvars.lua
index 1660d1dd6c..e00402ab3f 100644
--- a/runtime/lua/vim/_meta/vvars.lua
+++ b/runtime/lua/vim/_meta/vvars.lua
@@ -195,6 +195,7 @@ vim.v.errors = ...
--- changed_window Is `v:true` if the event fired while
--- changing window (or tab) on `DirChanged`.
--- status Job status or exit code, -1 means "unknown". `TermClose`
+--- reason Reason for completion being done. `CompleteDone`
--- @type any
vim.v.event = ...