Concern about prop_find/-remove()

14 views
Skip to first unread message

Axel Forsman

unread,
Mar 4, 2020, 11:13:32 AM3/4/20
to vim...@vim.org
Hello all:

The functions prop_remove() and prop_find() allow one to specify which
properties
to remove/search for by providing the id and/or type.
However as a property matches if either the id or type matches,
this means that if you want to add several new properties of a particular type
and then remove a *single* one of those,
all id:s have to be unique.
This, of course, is impossible in the presence of multiple plugins
creating props.

Furthermore, I fail to see when the current behavior would actually be wanted.
Am I missing something, or could this perhaps be fixed in some way or another?


Well met,
Axel Forsman

Bram Moolenaar

unread,
Mar 4, 2020, 3:51:34 PM3/4/20
to vim...@googlegroups.com, Axel Forsman, vim...@vim.org
It's possible that two plugins happen to use the same id or type in the
same line. For the type you can use a prefix to avoid most collisions.

A simple solution would be to add a "both" argument, then both the id
and the type needs to match. Does that solve your problem?

--
Very funny, Scotty. Now beam down my clothes.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages