Hi,
On Mon, May 23, 2022 at 1:40 PM Nick Jensen <[email protected]>
wrote:
> It's probably better to add a "replace" argument: If an autocommand for
> this group and event already exists, replace it with this one.
>
> I think either unique or replace are both fine (although unique is more
> descriptive in my mind), as long as the default value is true so we
> normally don't need to use it, or even know about it! It is very rare that
> an autocmd should *not* replace an existing one with the same group and
> event.
>
>
> If the 'replace' item is specified, then autocmd_add() will remove all the
commands
associated with an autocmd event in the group and add the new command. If a
group is not specified, then the default group will be used. This is same
as running
the following command:
autocmd! {group} {event} {pat} {cmd}
If we make 'replace' the default, then a call to autocmd_add() in a .vimrc
file will
remove commands added by a plugin (in the default group) for that event.
A user may not expect this. So we should not make 'replace' as the default.
- Yegappan
--
--
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 on the web visit
https://groups.google.com/d/msgid/vim_dev/CAAW7x7kke0k37zhKots2eWWLw46vvkUj9%2B%2Ba60z06aZz0e-h2g%40mail.gmail.com.