codetools: fixed InsertAllNewUnitsToMainUsesSection, issue #40522

This commit is contained in:
mattias 2023-09-25 22:13:53 +02:00
parent 1acc98a582
commit 00e6d8fbd8

View File

@ -8281,19 +8281,9 @@ begin
repeat
ReadNextAtom; // read name
if AtomIsChar(';') then break;
CurUnitName:=ExtractUsedUnitNameAtCursor();
CurUnitName:=ExtractUsedUnitNameAtCursor(); // moves cursor behind used unit and InFilename
RemoveNewMainUsesSectionUnit(PChar(CurUnitName));
if fNewMainUsesSectionUnits.Count=0 then exit;
ReadNextAtom;
while AtomIsChar('.') do
begin
ReadNextAtom;
ReadNextAtom;
end;
if UpAtomIs('IN') then begin
ReadNextAtom;
ReadNextAtom;
end;
if AtomIsChar(';') then break;
if not AtomIsChar(',') then break;
until (CurPos.StartPos>SrcLen);