aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
authorFelipe Vicentin <42344207+Vinschers@users.noreply.github.com>2025-02-02 01:25:38 +0100
committerGitHub <noreply@github.com>2025-02-01 16:25:38 -0800
commit289c9d21cb91ec6c47496230ca49eef42a04250c (patch)
tree7110c7195711618021eca8d9da96e97b4426f109 /src/nvim/eval/userfunc.c
parent0985e784d8dce58748343207e176bf61303b7d68 (diff)
downloadrneovim-289c9d21cb91ec6c47496230ca49eef42a04250c.tar.gz
rneovim-289c9d21cb91ec6c47496230ca49eef42a04250c.tar.bz2
rneovim-289c9d21cb91ec6c47496230ca49eef42a04250c.zip
fix(autocmds): once=true Lua event-handler may call itself #29544
Problem: Event handler declared with `once=true` can re-trigger itself (i.e. more than once!) by calling `nvim_exec_autocmds` or `:doautocmd`. Analysis: This happens because the callback is executed before deletion/cleanup (`aucmd_del`). And calling `aucmd_del` before `call_autocmd_callback` breaks the autocmd execution... Solution: Set `ac->pat=NULL` to temporarily "delete" the autocmd, then restore it after executing the callback. Fix #25526 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'src/nvim/eval/userfunc.c')
0 files changed, 0 insertions, 0 deletions