助手代码有个bug
function TCnInputHelper.UpdateCurrList(ForcePopup: Boolean): Boolean;
var
i, Idx: Integer;
Symbol: string;
begin
List.Items.BeginUpdate;
try
Symbol := UpperCase(FMatchStr);
//这个判断是在原有list进行筛选,而不用再重新生成列表,用于加快速度
//但这个条析永远都不会成立
//因为只要 Length(FLastStr) - Length(Symbol) = 1 成立, Pos(UpperCase(FLastStr), Symbol) = 1) 就不成立
if (Length(Symbol) > 1) and (Length(FLastStr) - Length(Symbol) = 1) and
(Pos(UpperCase(FLastStr), Symbol) = 1) then
//应改为
if (Length(Symbol) > 1) and (Length(FLastStr) - Length(Symbol) = -1) and
(Pos(UpperCase(FLastStr), Symbol) = 1) then
|