codetools: fixed InsertAllNewUnitsToMainUsesSection, issue #40522

(cherry picked from commit 00e6d8fbd8)
This commit is contained in:
mattias 2023-09-25 22:13:53 +02:00 committed by Maxim Ganetsky
parent d76ba3ddc8
commit 25013f7e7c

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);