mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 18:03:49 +02:00
Codetools: fix TIdentifierHistoryList.Add
- If an existing item moves to the front (to HistoryIndex=0) then all Indexes between 0 and the old value need updating (the old value became unused, so items above do not need an update). - If an new item is inserted, all existing items need to be increased.
This commit is contained in:
parent
b326ae6b5b
commit
ed410cb98c
@ -4562,14 +4562,14 @@ begin
|
||||
NewHistItem.Identifier:=NewItem.Identifier;
|
||||
NewHistItem.NodeDesc:=NewItem.GetDesc;
|
||||
NewHistItem.ParamList:=NewItem.ParamTypeList;
|
||||
AdjustIndex:=0;
|
||||
AdjustIndex:=high(AdjustIndex);
|
||||
end;
|
||||
NewHistItem.HistoryIndex:=0;
|
||||
// adjust all other HistoryIndex
|
||||
AnAVLNode:=Fitems.FindLowest;
|
||||
while AnAVLNode<>nil do begin
|
||||
AnHistItem:=TIdentHistListItem(AnAVLNode.Data);
|
||||
if AnHistItem.HistoryIndex>=AdjustIndex then
|
||||
if AnHistItem.HistoryIndex<AdjustIndex then
|
||||
inc(AnHistItem.HistoryIndex);
|
||||
AnAVLNode:=FItems.FindSuccessor(AnAVLNode);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user