[vim/vim] events are triggered for what happened while they were ignored (PR #21074)
h_east (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/[email protected]> |
```
Problem: Events that are triggered by comparing the current state against a
stored one are still reported once they are not ignored anymore.
This shows up when a command sets 'eventignore', changes something
and restores the option, since these events are only checked in
the main loop, which does not run while a command executes.
Solution: Move the checks done in the main loop into a function and also
call it when 'eventignore' or 'eventignorewin' changes, with the
old value in effect. What happened while an event was ignored is
then not reported, and what happened before still is.
```
related: #8641
Affects CursorMoved, CursorMovedI, TextChanged, TextChangedI, TextChangedP,
WinScrolled and WinResized. Every other event is triggered where it happens
and is dropped while it is ignored.
Changing the option several times works out: with "all", then "WinEnter",
then "", what happened under "all" is not reported and what happened under
"WinEnter" is.
Moving the whole block keeps popup_check_cursor_pos() and the 'conceal'
update working, which are not autocommands and must not be suppressed by
'eventignore'.
This is a behaviour change. In #8641 Bram wrote that something could be added
but "it would defeat plugins that do expect to get the CursorMoved event". A
plugin that sets 'eventignore' around an operation and relies on getting the
event afterwards will no longer get it.
Setting 'eventignore' can now trigger these events, when it starts ignoring
them and something was pending. Internal use through au_event_disable() is
not affected, since that goes through set_string_option_direct(), which does
not call the option handler.
You can view, comment on, or merge this pull request online at:
https://github.com/vim/vim/pull/21074
-- Commit Summary --
* events are triggered for what happened while they were ignored
-- File Changes --
M runtime/doc/options.txt (4)
M src/main.c (164)
M src/optionstr.c (15)
M src/proto/main.pro (1)
M src/testdir/test_autocmd.vim (163)
-- Patch Links --
https://github.com/vim/vim/pull/21074.patch
https://github.com/vim/vim/pull/21074.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21074
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21074%40github.com.