Add support for specifying a list of autocmd event names to autocmd_add()#10483
Add support for specifying a list of autocmd event names to autocmd_add()#10483yegappan wants to merge 1 commit intovim:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10483 +/- ##
=======================================
Coverage 81.67% 81.67%
=======================================
Files 158 158
Lines 185109 185162 +53
Branches 41867 41881 +14
=======================================
+ Hits 151187 151231 +44
- Misses 21469 21477 +8
- Partials 12453 12454 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Shouldn't we be more consistent here and either allow String for single events or list with multiple events? Or maybe even better disallow strings at all and only allow a list of events (since this is pretty new, shouldn't break users expectations yet I hope)? |
|
The most obvious would be allow for a string with a single item, and a list of strings with at least one item. |
|
Hi Christian,
On Thu, May 26, 2022 at 1:07 AM Christian Brabandt < ***@***.***> wrote:
either a String with one or more autocmd event names separated by comma or
a List of event names
Shouldn't we be more consistent here and either allow String for single
events or list with multiple events? Or maybe even better disallow strings
at all and only allow a list of events (since this is pretty new, shouldn't
break users expectations yet I hope)?
The autocmd_get() function returns a String for the event name and pattern.
If you want to pass the return value of the autocmd_get() function to the
autocmd_add() function, then we need to support the String type for the
event
name and pattern.
Regards,
Yegappan
|
e2ba2de to
e645351
Compare
The autocmd_add() function now supports either a String with one or more
autocmd event names separated by comma or a List of event names.
It also supports a String or a List for the autocmd pattern.