> One thing that won't work (even though it was not a good idea anyway):
> If code would use manual IDs of 1000 and higher, assuming that matches
> without a match ID would never reach 1000.
> This breaks, because your proposal sets the next_match_id to one more
> than the manual ID, thus they will very soon collide.
My proposal always sets next_match_id to be maximum of IDs + 1
even if it is manual or not, so nex_match_id will not collide.
For example:
firstly
matchaddpos('ToDo', [[1]], 10) returns 4
then
matchaddpos('ToDo', [[1]], 10, 1000) returns 1000
then
matchaddpos('ToDo', [[1]], 10) returns 1001
then
matchaddpos('ToDo', [[1]], 10) returns 1002
then
matchaddpos('ToDo', [[1]], 10, 500) returns 500
then
matchaddpos('ToDo', [[1]], 10) returns 1003
then
matchaddpos('ToDo', [[1]], 10, 2000) returns 2000
then
matchaddpos('ToDo', [[1]], 10) returns 2001
One of concerns in my proposal is that once a manual ID is too big
nex_match_id could eventually become integer overflow.
Please let me know if there is still a chance to collide the IDs.
--
--
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].
For more options, visit https://groups.google.com/d/optout.