OnSearchPosition
is the correct answer (but only, if it also does the filling of the list)
DoSearchPosition
Is a bad example.
And the checkboxes are horrible wrong.
"Filter in Search Position" Does enable/disable the entire event.
So set "Filter in Search Position" to checked.
Then look at search position. It currently always returns 0 (or -1).
It should return the index with the best match instead.
--------------------------------------
But I see what you mean.
This lets OnExecute unusable for the purpose of filling the list.
Yet we need to set the CurrentString first, because user code may have OnExecute events, that relay on it.
I would say something like
CurrentString := s;
if Assigned(OnExecute) then begin
OnExecute(Self);
CurrentString := s;
end;
Though that calls OnSearchPosition twice.
So better
if Assigned(OnExecute) then begin
CurrentStringDirect := s; // do not adjust position / better name needed
OnExecute(Self);
end;
CurrentString := s;
---------------
OnExecute may have called SetPosition. (that must be added to the list of incompatible changes.)
I think it is ok to ignore SetPosition calls from OnExecute. Since there is a dedicated event for this / and the pos from OnExecute is lost as soon as you keep typing.