aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/autocmd.c
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2024-02-15 19:56:58 -0600
committerGitHub <noreply@github.com>2024-02-15 19:56:58 -0600
commit55a4aa41bb27aa9439fea11c4ebcfec2ee87844d (patch)
treef7efbc4045fb7f3fe77cae2d7b3574dbac8e338f /src/nvim/api/autocmd.c
parent04dfa2eea914086a9f42a5a00a33e9524f9fded4 (diff)
downloadrneovim-55a4aa41bb27aa9439fea11c4ebcfec2ee87844d.tar.gz
rneovim-55a4aa41bb27aa9439fea11c4ebcfec2ee87844d.tar.bz2
rneovim-55a4aa41bb27aa9439fea11c4ebcfec2ee87844d.zip
docs: document breaking change for nvim_create_autocmd callback (#27484)
https://github.com/neovim/neovim/pull/27428 changed the semantics of callbacks passed to nvim_create_autocmd such that any truthy value will delete the autocommand (rather than just the literal boolean value `true`). Update the documentation accordingly and add an entry to `news.txt`. The behavior is now consistent between nvim_create_autocmd and nvim_buf_attach.
Diffstat (limited to 'src/nvim/api/autocmd.c')
-rw-r--r--src/nvim/api/autocmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index 4f67f682f1..90b7f3a5c6 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -378,8 +378,9 @@ cleanup:
/// |autocmd-buflocal|. Cannot be used with {pattern}.
/// - desc (string) optional: description (for documentation and troubleshooting).
/// - callback (function|string) optional: Lua function (or Vimscript function name, if
-/// string) called when the event(s) is triggered. Lua callback can return true to
-/// delete the autocommand, and receives a table argument with these keys:
+/// string) called when the event(s) is triggered. Lua callback can return a truthy
+/// value (not `false` or `nil`) to delete the autocommand. Receives a table argument
+/// with these keys:
/// - id: (number) autocommand id
/// - event: (string) name of the triggered event |autocmd-events|
/// - group: (number|nil) autocommand group id, if any